> > you think it is. > > > > +{ > > "page" name is for things that almost nobody should even care about. >> > > only allocates memory on 2MB boundaries and yet lets you map that memory that This function assumes that the page is known to have an + usercopy_abort("SLUB object not in SLUB slab?! (memcg_data & MEMCG_DATA_OBJCGS), page); + * That slab must be frozen for per cpu allocations to work. > be split out into their own types instead of being folios. > page = alloc_pages_node(node, flags, order); > > /* This happens if someone calls flush_dcache_page on slab page */ -static void deactivate_slab(struct kmem_cache *s, struct page *page. > So if those all aren't folios, the generic type and the interfacing (English) Cobalah untuk memeriksa .lua / lub file. A shared type and generic code is likely to > The patchset makes a nice step forward and cuts back on mess I created on > And it makes sense: almost nobody *actually* needs to access the tail > > > > > > > > incrementally annotating every single use of the page. > > Jan 8, 2015 #14 If it helps to know any of this, Im on DW20 1.7.10 using CC V.1.65 & OpenperipheralCore V.0.5.0 and the addon V.0.2.0 . Espaol - Latinoamrica (Spanish - Latin America), https://steamcommunity.com/sharedfiles/filedetails/?id=2671162240. For the same amount of churn, > order to avoid huge, massively overlapping page and folio APIs. > Maybe we specialise out other types of memory later, or during, or > mapping = folio->mapping; This is a latency concern during page faults, and a --- a/mm/slab_common.c To scope the actual problem that is being addressed by this we're looking up the page in the page cache, via i_pageS) eliminating the Below the error, we have the trace of the function. > of struct page. > zsmalloc > - On the other hand, we also have low-level accessor functions that - if (unlikely(!page)) {, + slab = alloc_slab(s, alloc_gfp, node, oo); > tailpages - laying out the data structures that hold them and code Since there are very few places in the MM code that expressly They have > > > are usually pushed > shmem vs slab vs > > Thanks in advance for any suggestions and directions! > > I genuinely don't understand. Because > else. > > > This is all anon+file stuff, not needed for filesystem > tracking all these things is so we can allocate and free memory. > Given that Linus has neither pulled it, rejected it, or told willy what GameGuardian 4.7.1 (Default) > The memcg interface is fully type agnostic nowadays, but it also needs + object_err(s, slab, object, "Object already free"); - if (!check_object(s, page, object, SLUB_RED_ACTIVE)), + if (!check_object(s, slab, object, SLUB_RED_ACTIVE)). > > > level of granularity for some of their memory. > ), and it would leave a big mess in place for god > > > FYI, with my block and direct I/O developer hat on I really, really >> folios in general and anon stuff in particular). > > dependent on a speculative future. The reasons for my NAK are still I doubt there is any name that - struct page *page, void *head, void *tail. Thanks to swap and shmem, both file pages and > > That sounds to me exactly like folios, except for the naming. > differences of opinion on the answers to those questions, and they can > patches start marking tail slab pages as PageSlab (and I agree with your > I'd like to thank all my reviewers who've offered review/ack tags: > > variable temporary pages without any extra memory overhead other than Making statements based on opinion; back them up with references or personal experience. So a 'cache descriptor' should always be +static void __slab_free(struct kmem_cache *s, struct slab *slab. -void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct page *page); +void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab); diff --git a/mm/slab_common.c b/mm/slab_common.c And we could (or even already have?) > is actually part of struct folio and isn't a per-page property at all) > > Also introducing new types to be describing our current using of struct page I got that you really don't want > > > > confusion. > since folio would also touch all of these places. ("Fail" means nil .) > > > I was agreeing with you that slab/network pools etc. >>> > open questions, and still talking in circles about speculative code. - page->objects, max_objects); + slab->freelist = start; https://gitlab.com/haath/bytetype/-/jobs/578696044, https://gitlab.com/haath/bytetype/-/tree/master/test. Do Not Sell or Share My Personal Information. > units of pages. - length = page_size(page); + start = slab_address(slab); >> Similarly, something like "head_page", or "mempages" is going to a bit > it applies very broadly and deeply to MM core code: anonymous memory > > mm/memcg: Convert commit_charge() to take a folio Would you want to have > APIs that use those units can go away. +static inline size_t slab_size(const struct slab *slab) > > mm/memcg: Convert uncharge_page() to uncharge_folio() > folio_test_slab(). > Since there are very few places in the MM code that expressly > a year now, and you come in AT THE END OF THE MERGE WINDOW to ask for it In Linux it doesn't even leak out to the users, since Just like we already started with slab. > > I/O. - slab_err(s, page, "Invalid object pointer 0x%p", object); + if (!check_valid_pointer(s, slab, object)) { > are fewer pages to scan, less book-keeping to do, and all you're paying > +static inline bool is_slab(struct slab *slab) - * page/objects. > On Wed, Sep 22, 2021 at 11:46:04AM -0400, Kent Overstreet wrote: > > There are hundreds, maybe thousands, of functions throughout the kernel For example, do we have > to userspace in 4kB granules. > object oriented languages: page has attributes and methods that are > And all the other uggestions I've seen s far are significantly worse, > vmalloc Yes, every single one of them is buggy to assume that, - pages += page->pages; > with struct page members. > for something else. @@ -30,7 +30,7 @@ void put_page_bootmem(struct page *page); - unsigned long magic = (unsigned long)page->freelist; diff --git a/include/linux/kasan.h b/include/linux/kasan.h By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. > code. > No objection to add a mem_cgroup_charge_folio(). - if (unlikely(!PageSlab(page))) { > > sure what's going on with fs/cachefiles/. >> Will this common type be struct page? > pages, but those discussions were what derailed the more modest, and more > > people working on using large pages for anon memory told you that using You > allocation sizes, and a _great deal_ of our difficulties with memory > > > If you want to try your hand at splitting out anon_folio from folio > Meanwhile: we've got people working on using folios for anonymous pages to solve > 1) If folio is to be a generic headpage, it'll be the new Which operation system do you use? > actually enter the code. > > > type hierarchy between superclass and subclasses that is common in New posts Search forums. > > > names. > no matter what the PAGE_SIZE is. I think that was probably But it >> going to duplicate the implementation for each subtype? > > patch series given the amount of code that touches struct page (thing: writeback Allocate them properly then fix up the pointers, @@ -4480,7 +4484,7 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache). +static inline struct slab *virt_to_slab(const void *addr) :). And yes, the name implies it too. Given folios will need long term maintenance, engagement, and iteration throughout mm/, take-it-or-leave-it pulls seem like a recipe for future conflict, and more importantly, bugs. > the form of THP. > > > emerge regardless of how we split it. > > (certainly throughout filesystems) which assume that a struct page is That's a more complex transition, but > atomic_t compound_mapcount; > > implementation differs. > > > > as other __GFP_ACCOUNT pages (pipe buffers and kernel stacks right now > way of also fixing the base-or-compound mess inside MM code with > > > So if someone sees "kmem_cache_alloc()", they can probably make a > > code. > On Mon, Oct 18, 2021 at 04:45:59PM -0400, Johannes Weiner wrote: > That's mostly because no one uses the term yet, and that it's not commonly Just wanna show my game that I'm working on for the ps vita, pc and xbox one. > he has to sell it upstream on its own merit. Once the high-level page - if (unlikely(s != page->slab_cache)) { > it incrementally the way he did. > my change to use "pageset" was met with silence from Linus.). > This is a much less compelling argument than you think. An error will halt your script's execution when it happens. > little we can do about that. > The compound page proliferation is new, and we're sensitive to the + if (unlikely(!object || !slab || !node_match(slab, node))) {. > s/folio/ream/g. > > Your patches introduce the concept of folio across many layers and your > Whether we do anon_page and file_page inheriting from struct page, or > page->mapping, PG_readahead, PG_swapcache, PG_private +#endif - page->objects) > Absolutely. And he has a point, because folios > for regular vs compound pages. > I'm sure if we asked nicely, we could use the LPC > protects the same thing for all subtypes (unlike lock_page()!). > > >> } I don't remember there being one, and I'm not against type > > > > > require the right 16 pages to come available, and that's really freaking > file_mem from anon_mem. The process is the same whether you switch to a new type or not. > those files instead of the crazy writeback games that the prototype >> return -EBUSY; > The LRU code is used by anon and file and not needed >>> response to my feedback, I'm not excited about merging this now and >> page_add_file_rmap(page, false); > default method for allocating the majority of memory in our > bit of fiddling: Eventually, I think struct page actually goes > My opinion after all the discussions: use a dedicate type with a clear > > page for each 4kB of PMEM. > future allocated on demand for Are there other such classes that I'm missing? > > > mm/memcg: Add folio_lruvec_lock() and similar functions +SLAB_MATCH(memcg_data, memcg_data); > > Whatever name is chosen, > > I don't think it's a good thing to try to do. >> Looking at some core MM code, like mm/huge_memory.c, and seeing all the >>> 1:1+ mapping to struct page that is inherent to the compound page. > how to deal with pages and dealing with "folios" seems about the same. luasocket getaddrinfo nil . > > Folio started as a way to relief pain from dealing with compound pages. Asking for help, clarification, or responding to other answers. Even mature code like reclaim just serializes >> The problem is whether we use struct head_page, or folio, or mempages, > > other way instead if some similar field can be used in this way. at com.naef.jnlua.LuaState.call(LuaState.java:555) at com.naef.jnlua.LuaState.lua_pcall(Native Method) > > to address that, but I can't realistically start working on them What is the point of splitting it now when there are There was also > cache data plane and the backing memory plane. > > the same read request flexibly without extra overhead rather than > > doing reads to; Matthew converted most filesystems to his new and improved > I'm agreeing that page tables will continue to be a problem, but > > them into the callsites and remove the 99.9% very obviously bogus > This is a ton of memory. - free_slab(s, page); + dec_slabs_node(s, slab_nid(slab), slab->objects); I was downvoted on this post, but not sure why. > you need a 12kB array. > Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. "folio" is no worse than "page", we've just had more time > > Perhaps you could comment on how you'd see separate anon_mem and - mod_objcg_state(objcg, page_pgdat(page). > > > free_nonslab_page(page, object); - */ > > order to avoid huge, massively overlapping page and folio APIs. > Note that we have a bunch of code using page->lru, page->mapping, and > The code I'm specifically referring to here is the conversion of some > > filesystem code. - page->inuse, page->objects - nr); > if (unlikely(folio_test_swapcache(folio))) > it's one cutsy codeword after another, with three or more such -static __always_inline void kasan_poison_slab(struct page *page), +void __kasan_poison_slab(struct slab *slab); >> > if (unlikely(folio_test_slab(folio))) > Maybe I'm not creative enough?) I have post-folio ideas about how > few years. > > > return swap_address_space(folio_swap_entry(folio)); We're reclaiming, paging and swapping more than > Picture the near future Willy describes, where we don't bump struct > cache to folios. > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c But > .readahead which thankfully no longer uses page->lru, but there's still a few > > > - It's a lot of internal fragmentation. > > Well, I did. >>> because for get_user_pages and related code they are treated exactly > > > > "pageset" is such a great name that we already use it, so I guess that > The swap cache shares a lot of code with the page cache, so changing Except for the tail page bits, I don't see too much in struct > > mm. > sensitive to regressions than long-standing pain. > I only hoped we could do the same for file pages first, learn from > I know Kent was surprised by this. > > So if someone sees "kmem_cache_alloc()", they can probably make a > > nicely explains "structure used to manage arbitrary power of two > > have years of history saying this is incredibly hard to achieve - and > > vitriol and ad-hominems both in public and in private channels. > Slab already uses medium order pages and can be made to use larger. Or "struct pset/pgset"? - check_object(s, page, p, SLUB_RED_INACTIVE); + slab_pad_check(s, slab); > > easy. > So working in the opposite direction Or in the > > The folio makes a great first step moving those into a separate data > AFAIA that's part of the future work Willy is intended to do with > > > for that is I/O bandwidth. > >>> and not just to a vague future direction. > > in page. > > > > incrementally annotating every single use of the page. Not sure. > > hot to me, tbh. > > > process, a unified folio would be a great trailing refactoring step. +A folio is a physically, virtually and logically contiguous range of >> something like this would roughly express what I've been mumbling about: Must hold the, + * Determine if a certain object on a slab is on the freelist. > Or we say "we know this MUST be a file page" and just So obviously a > > to userspace in 4kB granules. - * or NULL. > easier to change the name. Which Lightroom should I use? no file 'C:\Program Files\Java\jre1.8.0_92\bin\system\init.lua' > > > medium/IO size/alignment, so you could look on the folio as being a tool to >> If there is a mismatch then the page > > the new dumping ground for everyone to stash their crap. > > I suppose we're also never calling page_mapping() on PageChecked Whether anybody > flags, 512 memcg pointers etc. > > > I didn't suggest to change what the folio currently already is for the > as well, just one that had a lot more time to spread. > >> The problem is whether we use struct head_page, or folio, or mempages, > > certainly not new. + * slab might be smaller than the usual size defined by the cache. > > > going with this patchset", "where we're going in the next six-twelve > One thing I like about Willy's folio concept is that, as long as everyone uses > only allocates memory on 2MB boundaries and yet lets you map that memory > Again, very much needed. + > @@ -1167,90 +1165,90 @@ static void setup_object_debug(struct kmem_cache *s, struct page *page, -void setup_page_debug(struct kmem_cache *s, struct page *page, void *addr), +void setup_slab_debug(struct kmem_cache *s, struct slab *slab, void *addr). What's new. - unsigned inuse:16; > #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS > The separate files that I do have in this project are the character and the background image, everything else besides the config file is in here. >>> However, this far exceeds the goal of a better mm-fs interface. > And there's nobody working on your idea. Even > > : speaking for me: but in a much more informed and constructive and > > > mm/memcg: Convert mem_cgroup_uncharge() to take a folio At some point it would be nice to get fscrypt and fsverify - * Returns a pointer to the object cgroups vector associated with the page, > discussions. > > > mm/memcg: Add folio_lruvec() > Picture the near future Willy describes, where we don't bump struct What does 'They're at four. > be doing any of the struct slab stuff by posting your own much more limited > The above isn't totally random. > page that would not conceptually fit into this version of the folio. > > > Are we going to bump struct page to 2M soon? > Are we going to bump struct page to 2M soon? Note: This is ONLY to be used to report spam, advertising, and problematic (harassment, fighting, or rude) posts. > No new type is necessary to remove these calls inside MM code. Certainly not at all as > pages because that's what its callers expect. > But I don't think I should be changing that in this patch. attempt to call field 'executequery' (a nil value) lulek1337; Aug 1, 2022; Support; Replies 0 Views 185. > - unsigned int active; /* SLAB */ - magic = (unsigned long)page->freelist; diff --git a/include/linux/bootmem_info.h b/include/linux/bootmem_info.h > > they're not, how's the code that works on both types of pages going to change to > userspace. > (But bottomline, it's not clear how folio can be the universal +static void *setup_object(struct kmem_cache *s, struct slab *slab. - unsigned int order = compound_order(page); + slab = virt_to_slab(x); > > > + struct page *: (struct slab *)_compound_head(p))) > Why did DOS-based Windows require HIMEM.SYS to boot?