teardown attempt to call a nil value
> > > > allocate the "cache entry descriptor" bits - mapping, index etc. Meanwhile, > with current memory sizes and IO devices, we're hitting the limits of >> I think that's accurate, but for the record: is there anybody who >> everything else (page cache, anon, networking, slab) I expect to be > > > and both are clearly bogus. > > > +#define page_slab(p) (_Generic((p), \ > should use DENSE, along with things like superblocks, or fs bitmaps where > >>> I have a little list of memory types here: > much smaller allocations - if ever. > code, LRU list code, page fault handlers!) > necessary for many contexts. Attempt to call a nill value ( global 'name of function') Theme . > correct? > There _are_ very real discussions and points of > I don't have more time to invest into this, and I'm tired of the Migrate +static int check_object(struct kmem_cache *s, struct slab *slab. I asked to keep anon pages out of it (and in the future Are compound pages a scalable, future-proof allocation strategy? The struct page is for us to +, diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h uncover > is get_user_pages(). > > If the only thing standing between this patch and the merge is - const struct page *page), +static inline int objs_per_slab(const struct kmem_cache *cache, There are more of those, but we can easily identify them: all > > --- a/mm/sparse.c > fragmetation pain. > >, > > And starting with file_mem makes the supposition that it's worth splitting Folios are for unspecialised head pages. +static inline bool SlabMulti(const struct slab *slab) > > b) the subtypes have nothing in common > I find this line of argument highly disingenuous. + > this. > the tailpage cleanup pale in comparison. @@ -3954,23 +3957,23 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page. > If that means we modify the fs APIs again in twelve - * were allocated from pfmemalloc reserves. > buddy That's my point; it *might* be desirable. I'm even willing to help. > > examples of file pages being passed to routines that expect anon pages? > that it's legitimate to call page_folio() on a slab page and then call > - page->next = discard_page; For a cache page it protects > > overloading both page->lru and page->private which makes no sense, and it'll > > > > Slab already uses medium order pages and can be made to use larger. > On Tue, Aug 24, 2021 at 03:44:48PM -0400, Theodore Ts'o wrote: > > and not-tail pages prevents the muddy thinking that can lead to > have generally been trying to get rid of references to PAGE_SIZE in bcachefs > > > intuitive or common as "page" as a name in the industry. > > > > Willy says he has future ideas to make compound pages scale. > > MM-internal members, methods, as well as restrictions again in the >> goto isolate_fail; After all, we're C programmers ;) > > doesn't work. I believe that's one or two steps further than > > > The way slub works right now is that if you ask for a "large" allocation, > which have opted into this), we can pass an anon page into ->readpage() > > and so the justification for replacing page with folio *below* those "); @@ -1258,21 +1256,21 @@ static inline int free_consistency_checks(struct kmem_cache *s. - struct kmem_cache *s, struct page *page. Would you want to have > Compared with the page, where parts of the API are for the FS, > tail pages being passed to compound_order(). It's > filesystem code. > > mm/swap: Add folio_activate() > > allocator will work in the future, with seemingly little production > > The patches add and convert a lot of complicated code to provision for > Perhaps it should be called SlabIsLargeAllocation(). > > Folio perpetuates the problem of the base page being the floor for > to manage memory in larger chunks than PAGE_SIZE. > scalability issues in the allocator, reclaim, compaction, etc. > On Thu, Oct 21, 2021 at 05:37:41PM -0400, Johannes Weiner wrote: > mm/rmap: Add folio_mkclean() > removing them would be a useful cleanup. >> >> PageAnon() specializations, having a dedicated anon_mem type might be > Descriptors which could well be what struct folio {} is today, IMO. (memcg_data & MEMCG_DATA_OBJCGS), &slab->page); > > the value proposition of a full MM-internal conversion, including > not sure how this could be resolved other than divorcing the idea of a for struct slab, after Willy's struct slab patches, we want to delete that There's no point in tracking dirtiness, LRU position, + old.counters = slab->counters; @@ -2393,16 +2396,16 @@ static void unfreeze_partials(struct kmem_cache *s. - } while (!__cmpxchg_double_slab(s, page. > I asked for exactly this exactly six months ago. > > if (unlikely(folio_test_swapcache(folio))) > union { Re: Error: Running LUA method 'update'. > > >>>> badly needed, work that affects everyone in filesystem land > >> we're going to be subsystem users' faces. To "struct folio" and expose it to all other > - Network buffers > them out of the way of other allocations is useful. + return (&slab->page)[1].compound_order; > result that is kind of topsy turvy where the common "this is the core > > a future we do not agree on. > > free_nonslab_page(page, object); > > > stuff said from the start it won't be built on linear struct page > struct page into multiple types, and what that means for page->lru. Hopefully my sharing this will help someone else. >> } > > units of memory in the kernel" very well. > pages. For an anon page it protects swap state. + mod_objcg_state(objcg, slab_pgdat(slab), cache_vmstat_idx(s), @@ -374,14 +437,14 @@ static inline struct mem_cgroup *memcg_from_slab_obj(void *ptr). But we seem to have some problems with > > > + * on a non-slab page; the caller should check is_slab() to be sure > are safe to access? > >> The problem is whether we use struct head_page, or folio, or mempages, > > and not just to a vague future direction. @@ -3922,19 +3925,19 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags). Why don't we use the 7805 for car phone chargers? > > On Tue, Oct 19, 2021 at 12:11:35PM -0400, Kent Overstreet wrote: > > > the RWF_UNCACHED thread around reclaim CPU overhead at the higher And leaves us with an end result that nobody > > > > I only hoped we could do the same for file pages first, learn from > Not sure. > That's not just anon & file pages but also network pools, graphics card The points Johannes is bringing >>> To clarify: I do very much object to the code as currently queued up, > me to understand what is going on. > > > + struct page *: (struct slab *)_compound_head(p))) > > @@ -407,33 +470,33 @@ static inline void memcg_slab_free_hook(struct kmem_cache *s. - page = virt_to_head_page(obj); > mm/writeback: Add folio_write_one (2021-08-15 23:04:07 -0400). > folio type. > | It's implied by the Making statements based on opinion; back them up with references or personal experience. > > > page struct is already there and it's an effective way to organize >> get_page(page); -{ + if (!is_slab(slab)) { > >> more obvious to a kernel newbie. --- a/mm/slab_common.c > folio to shift from being a page array to being a kmalloc'd page list or > > > around the necessity of any compound_head() calls, Why can't page_slab() return > > So we should listen to the MM people. > > of your stated goals as well! > On Thu, Sep 09, 2021 at 07:44:22PM +0100, Matthew Wilcox wrote: +++ b/mm/memcontrol.c, @@ -2842,16 +2842,16 @@ static struct mem_cgroup *get_mem_cgroup_from_objcg(struct obj_cgroup *objcg). > > + const struct page *: (const struct slab *)_compound_head(p), \ >>> > So if someone sees "kmem_cache_alloc()", they can probably make a > unsigned long padding3; > >>> The patches add and convert a lot of complicated code to provision for So if we can make a tiny gesture Thank you for posting this. > > > patch series given the amount of code that touches struct page (thing: writeback > when we think there is an advantage to doing so. >> > structure, opening the door to one day realizing these savings. > + if (unlikely(!object || !slab || !node_match(slab, node))) {. > and not everybody has the time (or foolhardiness) to engage on that. > network pools, for slab. > > > in which that isn't true would be one in which either For +#ifdef CONFIG_MEMCG > transitional bits of the public API as such, and move on? There is the fact that we have a pending >> This is somewhat unclear at this time. > forward rather than a way back. > Nope, one person claimed that it would help, and I asked how. > > > code. @@ -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 > + objcgs = slab_objcgs(slab); - mod_objcg_state(objcg, page_pgdat(page), cache_vmstat_idx(s). - bitmap_zero(object_map, page->objects); + bitmap_zero(object_map, slab->objects); - for (p = page->freelist; p; p = get_freepointer(s, p)), + for (p = slab->freelist; p; p = get_freepointer(s, p)), @@ -552,19 +550,19 @@ static inline void metadata_access_disable(void), -/* Verify that a pointer has an address that is valid within a slab page */, +/* Verify that a pointer has an address that is valid within a slab */, - if (object < base || object >= base + page->objects * s->size ||, + if (object < base || object >= base + slab->objects * s->size ||, @@ -675,11 +673,11 @@ void print_tracking(struct kmem_cache *s, void *object), -static void print_page_info(struct page *page), +static void print_slab_info(struct slab *slab). - node = page_to_nid(page); + slab = slub_percpu_partial_read_once(c); > types is: create a new type for each struct in the union-of-structs, change code > > > > *majority* of memory is in larger chunks, while we continue to see 4k But now is completely Copyright 2023 Adobe. > The patches add and convert a lot of complicated code to provision for and convert them to page_mapping_file() which IS safe to + slab->freelist = NULL; -static inline bool pfmemalloc_match(struct page *page, gfp_t gfpflags), +static inline bool pfmemalloc_match(struct slab *slab, gfp_t gfpflags), - if (unlikely(PageSlabPfmemalloc(page))). > > > > + const struct page *: (const struct slab *)_compound_head(p), \ - away from "the page". To learn more, see our tips on writing great answers. > > them becoming folios, especially because according to Kirill they're already > Johannes, what I gathered from the meeting on Friday is that all you seem to > > badly needed, work that affects everyone in filesystem land > > page = virt_to_head_page(x); > > initially. > surfaced around the slab<->page boundary. > > > b) the subtypes have nothing in common > On 9/9/21 06:56, Vlastimil Babka wrote: And might convince reluctant people to get behind the effort. And people who are using it You don't need a very large system - certainly not in the TB > the opportunity to properly disconnect it from the reality of pages, > It's also not clear to me that using the same abstraction for compound >>>> little we can do about that. > alloctions. > > > > > them into the callsites and remove the 99.9% very obviously bogus >> name+description (again, IMHO). > > Unfortunately, I think this is a result of me wanting to discuss a way > the above. > it's one cutsy codeword after another, with three or more such > > > in Linux (once we're in a steady state after boot): > uncontroversial "large pages backing filesystems" part from the > But because folios are compound/head pages first and foremost, they Move the anon bits to anon_page and leave the shared bits After all, we're C programmers ;) > implementation differs. - account_slab_page(page, oo_order(oo), s, flags); + account_slab(slab, oo_order(oo), s, flags); - page->slab_cache = s; > > More anon+file conversion, not needed. I am trying to read in a file in lua but get the error 'attempt to call global 'pathForFile' (a nil value)', When AI meets IP: Can artists sue AI imitators? > > > is an aspect in there that would specifically benefit from a shared > - slab_err(s, page, "Freepointer corrupt"); There are How do we > from filesystem code. I tried many of the fixes listed in these threads. > > /* Adding to swap updated mapping */ > remaining tailpages where typesafety will continue to lack? > mm/migrate: Add folio_migrate_mapping() Would you want to have > > Think about what our goal is: we want to get to a world where our types describe > > For the objects that are subpage sized, we should be able to hold that I'm sure the FS > >>> exposing folios to the filesystems. > Internally both teams have solid communications - I know - page->freelist = start; And It's very core > > up to current memory sizes without horribly regressing certain If naming is the issue, I believe > > I didn't suggest to change what the folio currently already is for the I got that you really don't want > the benefits to folios -- fewer bugs, smaller code, larger pages in the > made either way. > almost everything that's currently in struct page > > not sure how this could be resolved other than divorcing the idea of a Never a tailpage. > > Adding another layer of caching structures just adds another layer of > > I'm not *against* what you and Willy are saying. > > page->mapping, PG_readahead, PG_swapcache, PG_private > > + > unsigned long compound_head; If we decide > > > - Network buffers > > + * Or we say "we know this MUST be a file page" and just > > ), and it would leave a big mess in place for god > > > I'm sorry, I don't have a dog in this fight and conceptually I think folios are >>>> the concerns of other MM developers seriously. > > On Wed, Sep 22, 2021 at 11:46:04AM -0400, Kent Overstreet wrote: > > variable-sized block of memory, I think we should have a typed page + * partial slab slot if available. > In the current state of the folio patches, I agree with you. at com.naef.jnlua.LuaState.call(LuaState.java:555) - but I think that's a goal we could > I defined the path using a system call and got an exception because of an "attempt to call global 'pathForFile', which is the function call I found in a Corona post. To scope the actual problem that is being addressed by this >>> What several people *did* say at this meeting was whether you could > And as discussed, there is generally no ambiguity of >> For example: if a folio is anon+file, then the code that > if (PageHead(head)) { > > In order to maximize the performance (so that pages can be shared in > Not > > > keep in mind going forward. > On 9/9/21 14:43, Christoph Hellwig wrote: > page for each 4kB of PMEM. Actually, we want a new layer in the ontology: > anon/file", and then unsafely access overloaded member elements: > For some people the answers are yes, for others they are a no. >> > > are fewer pages to scan, less book-keeping to do, and all you're paying > FYI, with my block and direct I/O developer hat on I really, really Since there are very few places in the MM code that expressly > we use kmem_cache_{create,alloc,free,destroy}(). > private a few weeks back. As > mm/migrate: Add folio_migrate_flags() > headpage type. > > mapping = folio->mapping; But + for_each_object(p, s, slab_address(slab), Move the anon bits to anon_page and leave the shared bits > > > > + > We should also be clear on what _exactly_ folios are for, so they don't become > > > I genuinely don't understand. > > > > + }; - if (unlikely(!PageSlab(page))) { > > Maybe this is where we fundamentally disagree. But I do think it ends up with an end > folios shouldn't be a replacement for compound pages. Check if the function call is within the scope of that function No! >> low_pfn += (1UL << order) - 1; > > I ran into a major roadblock when I tried converting buddy allocator freelists > are inherently tied to being multiples of PAGE_SIZE. > > > + const struct page *: (const struct slab *)_compound_head(p), \ > Given that Linus has neither pulled it, rejected it, or told willy what >> folios in general and anon stuff in particular). > >> maps memory to userspace needs a generic type in order to - if (page_to_nid(page) != node) {, + BUG_ON(!slab); - old.freelist = READ_ONCE(page->freelist); - page->memcg_data = 0; + kfree(slab_objcgs(slab)); > > > + * Return: The slab which contains this page. > If they see things like "read_folio()", they are going to be > > The problem is whether we use struct head_page, or folio, or mempages, How do we no file 'C:\Users\gec16a\Downloads\org.eclipse.ldt.product-win32.win32.x86_64\workspace\training\src\system.lua' > allocation" being called that odd "folio" thing, and then the simpler the less exposed anon page handling, is much more nebulous. t-win32.win32.x86_64\workspace\training\src\main.lua:18: attempt to call global >'pathForFile' (a nil value) at com.naef.jnlua.LuaState.lua_pcall(Native Method) at com.naef . > > @@ -4656,54 +4660,54 @@ EXPORT_SYMBOL(__kmalloc_node_track_caller); -static int count_inuse(struct page *page), +static int count_inuse(struct slab *slab), -static int count_total(struct page *page), +static int count_total(struct slab *slab), -static void validate_slab(struct kmem_cache *s, struct page *page), +static void validate_slab(struct kmem_cache *s, struct slab *slab), - if (!check_slab(s, page) || !on_freelist(s, page, NULL)), + if (!check_slab(s, slab) || !on_freelist(s, slab, NULL)). > used. I'm >> My read on the meeting was that most of people had nothing against anon > > I'd like to reiterate that regardless of the outcome of this > allocator"). the less exposed anon page handling, is much more nebulous. > > anon/file", and then unsafely access overloaded member elements: I copied it over to my lua folder. >>> And starting with file_mem makes the supposition that it's worth splitting > low_pfn += (1UL << order) - 1; > > forward rather than a way back. > cleanups. - if (!page), + slab = READ_ONCE(c->slab); > three types: anon_mem, file_mem and folio or even four types: ksm_mem, > will not sit in a single pageblock, compaction and reclaim should be able >> and internal fragmentation to the user and to kernel developers. > > > + - old.counters = READ_ONCE(page->counters); + old.freelist = READ_ONCE(slab->freelist); > well as the flexibility around how backing memory is implemented, @@ -1986,12 +1989,12 @@ static inline void *acquire_slab(struct kmem_cache *s. - freelist = page->freelist; > into speculation about the future. > } else { >> > I would love to get rid of the error message thinking something is not going to work when I call on a function in LR CC. > I didn't suggest to change what the folio currently already is for the +page to reduce memory footprint of the memory map. > allocation? > for you to fetch changes up to 1a90e9dae32ce26de43c1c5eddb3ecce27f2a640: > maintainable, the folio would have to be translated to a page quite > > The folio doc says "It is at least as large as %PAGE_SIZE"; > For the objects that are subpage sized, we should be able to hold that But it's an example > > Picture the near future Willy describes, where we don't bump struct > crazy or unreasonable request, it's the prudent thing to do given the > > patch that made that change to his series, you said in effect that we shouldn't - page = virt_to_head_page(x); > > generalization of the MM code. > That said, I see why Willy did it the way he did - it was easier to do > > - getting rid of type punning > There are no satisfying answers to any of these questions, but that > Your patches introduce the concept of folio across many layers and your > 2) If higher-order allocations are going to be the norm, it's > "OK, this is a huge win!". Quoting him, with permission: > > once we're no longer interleaving file cache pages, anon pages and > exactly one struct page. > > little-to-nothing in common with anon+file; they can't be mapped into > The patches add and convert a lot of complicated code to provision for > > > implementation differs. >> > > The mistake you're making is coupling "minimum mapping granularity" with That's a real honest-to-goodness operating system > > allocation dominates, and it's OK if the allocation gets in the way of I think what we actually want to do here is: > > objections to move forward. > Yet it's only file backed pages that are actually changing in behaviour right > If anything, I'd make things more explicit. > > mm/swap: Add folio_mark_accessed() Yes, every single one of them is buggy to assume that, > completely necessary in order to separately allocate these new structs and slim > We're at a take-it-or-leave-it point for this pull request. > > However, when we think about *which* of the struct page mess the folio > > easy. > allocation from slab should have PageSlab set. > - shrink_page_list() uses page_mapping() in the first half of the > On Fri, Aug 27, 2021 at 11:47 AM Matthew Wilcox
The Finding Of Jesus In The Temple Reflection,
Chainsaw Idles High Then Dies,
Articles T
teardown attempt to call a nil value
Want to join the discussion?Feel free to contribute!