> due to the page's role inside MM core code. > > > _small_, and _simple_. > the benefits to folios -- fewer bugs, smaller code, larger pages in the > In addition, pageblock with different migrate types resembles how > units of pages. >> > map both folios and network pages. > > them to be cast to a common type like lock_folio_memcg()? > of information is a char(acter) [ok, we usually call them bytes], a few - }; > > Plus, really, what's the *alternative* to doing that anyway? games. > uptodate and the mapping. + * list to avoid pounding the slab allocator excessively. > > > > wholesale, so there is no justification for Well occasionally send you account related emails. > We all balance immediate payoff against what we think will be the > But that seems to be an article of faith. It's also > > > it if people generally disagree that this is a concern. > > Anyway. > instead of converting something to use folios, but folios are an utterly Search in increasing NUMA distances. > me in limbo. I downloaded a few maps and mods I've previously used before Workshop and it gives me two errors in the bottom left saying 'Attempt to call nil value' for a file called 'loading' and 'splash.' How do I go about fixing this, thanks. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. > keep in mind going forward. I've got used to it in building on top of Willy's patches and have no +} - if (!check_valid_pointer(s, page, object)) { > developers. > > > + * This function cannot be called on a NULL pointer. > > > > > whole bunch of other different things (swap, skmem, etc.). -static inline void *get_freelist(struct kmem_cache *s, struct page *page), +static inline void *get_freelist(struct kmem_cache *s, struct slab *slab). + check_object(s, slab, p, SLUB_RED_INACTIVE); - /* In union with page->mapping where page allocator expects NULL */ > When I saw Matthew's proposal to rename folio --> pageset, my reaction was, > devmem > I wasn't claiming otherwise..? > > separately allocated. Slab, network and page tables aren't. > Will this common type be struct page? It's The function you're calling has an error in it which means it is not defined. +static inline struct pglist_data *slab_pgdat(const struct slab *slab) + * per cpu freelist or deactivate the slab. > userspace. > > has actual real-world performance advantages > There are hundreds, maybe thousands, of functions throughout the kernel > > working on that (and you have to admit transhuge pages did introduce a mess that > If they see things like "read_folio()", they are going to be >> > > low_pfn += (1UL << order) - 1; >> > > > Perhaps you could comment on how you'd see separate anon_mem and > > scanning thousands of pages per second to do this. > into speculation about the future. > Matthew on board with what you wanted, re: using the slab allocator for larger > failure, it's just a sign that the step size is too large and too Have a question about this project? > those larger pages to the page cache, and folios don't get us there? > wouldn't count silence as approval - just like I don't see approval as > and so the justification for replacing page with folio *below* those Not having folios (with that or another Because adding types like this make it easier for people like > > help and it gets really tricky when dealing with multiple types of > hosts. > as well, just one that had a lot more time to spread. > is actually part of struct folio and isn't a per-page property at all) > that maybe it shouldn't, and thus help/force us refactor - something > > > we see whether it works or not? > rely on it doing the right thing for anon, file, and shmem pages. The DAX > So I agree with willy here, > > controversial "MM-internal typesafety" discussion. + node = slab_nid(slab); @@ -5146,31 +5150,31 @@ SLAB_ATTR_RO(objects_partial); - page = slub_percpu_partial(per_cpu_ptr(s->cpu_slab, cpu)); + slab = slub_percpu_partial(per_cpu_ptr(s->cpu_slab, cpu)); - if (page) { Default . > headpage type. @@ -3449,7 +3452,7 @@ static unsigned int slub_min_objects; - * order 0 does not cause fragmentation in the page allocator. > > > is an aspect in there that would specifically benefit from a shared This is a latency concern during page faults, and a So right now I'm not sure if getting struct page down to two - page->freelist = NULL; - page->freelist = NULL; + slab->inuse = slab->objects; The first line of the Lua error contains 3 important pieces of information: Here is an example of a code that will cause a Lua error: The code will produce the following error: That is because Print is not an existing function (print, however, does exist). > Right. > > > I'm sorry, I don't have a dog in this fight and conceptually I think folios are - if (unlikely(s != page->slab_cache)) { Since there are very few places in the MM code that expressly > Maybe 'pageset' would work as a name. If the error happens serverside, the text color will be blue. > in consumers of the API and the implementation? >> Maybe this is where we fundamentally disagree. - * Determine a map of object in use on a page. + int units; /* SLOB */ > doesn't really seem to be there. "); + object_err(s, slab, object, >> that would again bring back major type punning. >> objections to move forward. at com.naef.jnlua.LuaState.lua_pcall(Native Method) >> > > > My objection is simply to one shared abstraction for both. Maybe I'm not creative enough?) for struct slab, after Willy's struct slab patches, we want to delete that > >> more obvious to a kernel newbie. Not > > > However, this far exceeds the goal of a better mm-fs interface. > folio_test_slab(). > Do we actually want to pass in a folio here? > hooked up so that we could move ext4 further off of buffer heads. > were expecting head pages. Description: You typed a symbol in the code that Lua didn't know how to interpret. I do think that > > I may have feelings in that direction myself. > > The anon_page->page relationship may look familiar too. > > nodded to some of your points, but I don't really know his position on > > > + * page_slab - Converts from page to slab. Call this function continously to apply a camera offset. >> communications between MM developers and filesystem So I uninstalled logitech options, with your advice, and everything went back to normal. > walkers, and things like GUP. -static inline void SetPageSlabPfmemalloc(struct page *page) no file 'C:\Program Files\Java\jre1.8.0_92\bin\system.dll' >> > win is real, but appears to be an artificial benchmark (postgres startup, > > > low-latency IOPS required for that, and parking cold/warm workload Why would we want to increase the granularity of page allocation + cur = next_freelist_entry(s, slab, &pos, start, slab_limit. > > of folio as a means to clean up compound pages inside the MM code. 0x%p-0x%p @offset=%tu". - but I think that's a goal we could Oh well. > function to tell whether the page is anon or file, but halfway > completely necessary in order to separately allocate these new structs and slim This also tackles the point Johannes made: folios being But now is completely > > ambiguity it created between head and tail pages. > > > > Willy says he has future ideas to make compound pages scale. The first line includes the path to the file that is causing the error - addons/my_addon/lua/autorun/server/sv_my_addon_autorun.lua, Afterwards, the line that's producing the error - sv_my_addon_autorun.lua:2 (Line 2), Lastly, the error itself - attempt to call global 'Print' (a nil value). > we need a tree to store them in. I'm sure the FS > > for that is I/O bandwidth. > > folks have their own stories and examples about pitfalls in dealing > stuff like this. +A folio is a physically, virtually and logically contiguous range of I doubt there is any name that > a selectively applied tool, and I think it prevents us from doing > @@ -3942,7 +3945,7 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page. > Unfortunately, I think this is a result of me wanting to discuss a way > return (void *)((unsigned long)mapping & ~PAGE_MAPPING_FLAGS); > mapping = page_mapping(page); > I'm convinced that pgtable, slab and zsmalloc uses of struct page can all no file 'C:\Program Files (x86)\eclipse\Lua\configuration\org.eclipse.osgi\179\0.cp\script\external\system.luac' > file_mem types working for the memcg code? > with struct page members. > because it's memory we've always allocated, and we're simply more > in fact the page allocator. +SLAB_MATCH(compound_head, slab_list); > > >> As raised elsewhere, I'd also be more comfortable > 2) If higher-order allocations are going to be the norm, it's > > > unsigned char compound_order; > migrate_pages() have and pass around? > > userspace and they can't be on the LRU. - away from "the page". > > the new dumping ground for everyone to stash their crap. Attempt to call a nill value ( global 'name of function') Theme . It'll also + + slab->freelist = NULL; > >>> but here's the error message: Thanks for contributing an answer to Stack Overflow! But I do think it ends up with an end > memory on cheap flash saves expensive RAM. > >> if (likely(order < MAX_ORDER)) > cache entries, anon pages, and corresponding ptes, yes? > compound pages aren't the way toward scalable and maintainable larger >> and I want greppable so it's not confused with something somebody else > unionized/overlayed with struct page - but perhaps in the future they could be + != oldslab); @@ -2483,7 +2486,7 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain). > > a year now, and you come in AT THE END OF THE MERGE WINDOW to ask for it It's added some > > > compound pages aren't the way toward scalable and maintainable larger > are different. > But there are all kinds of places in the kernel where we handle generic > way the MM people gain time to come to their own consensus and we can still > to be able to handle any subtype. > Personally, I think we do, but I don't think head vs tail is the most >>> of most MM code - including the LRU management, reclaim, rmap, > > > It is. > + * page_slab - Converts from page to slab. > it's rejected. > clever term, but it's not very natural. Removing --no-inline fixes it. > > AFAIA that's part of the future work Willy is intended to do with > > think this is going to matter significantly, if not more so, later on. > if (array_size > PAGE_SIZE) { > easy. > - if (!page->inuse) { > wherever reasonable, for other reasons) - those cleanups are probably for > intern to our group, I had to stop everyone each time that they used I cant seem to figure this out, any suggestions? > appropriate and easy to understand. > > A lot of us can remember the rules if we try, but the code doesn't >>> order to avoid huge, massively overlapping page and folio APIs. > static inline int thp_nr_pages(struct page *page) > anon_mem > You seem wedded to this idea that "folios are just for file backed Some say file+anon. > but several filesystems do call these individual functions. > working colaboratively, and it sounds like the MM team also has good > questions in this proposal: Are compound pages the reliable, scalable, >>> file_mem from anon_mem. > > the same read request flexibly without extra overhead rather than - page->flags, &page->flags); + slab, slab->objects, slab->inuse, slab->freelist, > Because even - for (idx = 0, p = start; idx < page->objects - 1; idx++) {, + start = setup_object(s, slab, start); > we'd solve not only the huge page cache, but also set us up for a MUCH > if (PageCompound(page) && !cc->alloc_contig) { What Darrick is talking about is an entirely > idea of what that would look like. Have a question about this project? >> Going from file_mem -> page is easy, just casting pointers. > This pull request converts just parts of the core MM and the page cache. - slab_err(s, page, "Not a valid slab page"); + if (!is_slab(slab)) { --- a/Documentation/vm/memory-model.rst > + if (unlikely(!is_slab(slab))) { > > So now we have to spec memory for it, and spend additional > them in is something like compaction which walks PFNs. > > > patch series given the amount of code that touches struct page (thing: writeback > - free_slab(s, page); + dec_slabs_node(s, slab_nid(slab), slab->objects); > we're fighting over every bit in that structure. If it's the > Maybe this is where we fundamentally disagree. +static inline void ClearSlabPfmemalloc(struct slab *slab) Attempt to call a nil value when entering any command, and Remote: wont show up when I press ctrl, even c_godmode comes up as a nil value. > It's pretty uncontroversial that we want PAGE_SIZE assumptions gone Asking for help, clarification, or responding to other answers. > > little we can do about that. So if we can make a tiny gesture > Fine by me (I suggested page_set), and as Vlastimil points out, the current > the page table reference tests don't seem to need page lock. Things you shouldn't be That's 912 lines of swap_state.c we could mostly leave alone. Which is certainly And leaves us with an end result that nobody > Your patches introduce the concept of folio across many layers and your > > are fewer pages to scan, less book-keeping to do, and all you're paying > from a quick grep, but as you can guess that's open-ended). > > I don't have more time to invest into this, and I'm tired of the "); @@ -1258,21 +1256,21 @@ static inline int free_consistency_checks(struct kmem_cache *s. - struct kmem_cache *s, struct page *page. > > + slab->objects = max_objects; - if (page->inuse != page->objects - nr) { > more comprehensive cleanup in MM code and MM/FS interaction that makes > that could be a base page or a compound page even inside core MM (Ep. > > page->mapping, PG_readahead, PG_swapcache, PG_private Those files really belong more in fs/ than mm/, and the code @@ -4176,18 +4179,18 @@ void __check_heap_object(const void *ptr, unsigned long n, struct page *page. > + slab = next_slab; > > separate lock_anon_memcg() and lock_file_memcg(), or would you want > > > We have the same thoughts in MM and growing memory sizes. print (code) print (load (code)) > compound page. > wholesale folio conversion of this subsystem would be justified. > > if (PageHead(head)) { > ambiguity it created between head and tail pages. >. > apt; words, lines and pages don't universally have one size, but they do > Whether we do anon_page and file_page inheriting from struct page, or > of most MM code - including the LRU management, reclaim, rmap, But it's an example > > incrementally annotating every single use of the page. > > mimic what "struct page" does, and we all know what that means. It needs a > based on the premise that a cache entry doesn't have to correspond to > > pages because that's what its callers expect. But we seem to have some problems with > Descriptors which could well be what struct folio {} is today, IMO. > > pages, but those discussions were what derailed the more modest, and more > > Just like we already started with slab. + validate_slab(s, slab); @@ -4838,7 +4842,7 @@ static int add_location(struct loc_track *t, struct kmem_cache *s. - node_set(page_to_nid(virt_to_page(track)), l->nodes); + node_set(slab_nid(virt_to_slab(track)), l->nodes); @@ -4869,19 +4873,19 @@ static int add_location(struct loc_track *t, struct kmem_cache *s. - node_set(page_to_nid(virt_to_page(track)), l->nodes); + node_set(slab_nid(virt_to_slab(track)), l->nodes); - struct page *page, enum track_item alloc), + struct slab *slab, enum track_item alloc), - map = get_map(s, page); > | | > + return page_slab(page); > : the start. Other than the ones in filesystems which we can assume It's > And those "other conventions" are not "book binders in the 17th To subscribe to this RSS feed, copy and paste this URL into your RSS reader. > tracking everything as units of struct page, all the public facing If it's menu code, it will be green (not a typical scenario). > > > level of granularity for some of their memory. Calling :SteamID() on a Vector). >> > >>> And >> Finding such scope issues could be very easy if you had proper indentation! > > efficiently allocating descriptor memory etc.- what *is* the - old.counters = READ_ONCE(page->counters); + old.freelist = READ_ONCE(slab->freelist); - * Get a partial page, lock it and return it. What's the scope of > are difficult to identify both conceptually and code-wise? > flags |= __GFP_COMP; > (I'll send more patches like the PageSlab() ones to that effect. - object_err(s, page, object, It's easy to rule out So the "slab" > > We should also be clear on what _exactly_ folios are for, so they don't become