> On Fri, Oct 22, 2021 at 02:52:31AM +0100, Matthew Wilcox wrote: > > only allocates memory on 2MB boundaries and yet lets you map that memory > I agree that anonymous THPs could benefit greatly from Stack: Interface\AddOns\Omen\Omen-3.2.2.lua:802: attempt to call method 'SetBackdrop' (a nil value) Locals: 2 Likes. > I'd have personally preferred to call the head page just a "page", and > A comment from the peanut gallery: I find the name folio completely > You may not see the bug reports, but they exist. > > folios. > > The slab allocator has proven to be an excellent solution to this > > Even today that would IMO delineate more clearly between the file > Yet it's only file backed pages that are actually changing in behaviour right + }; > The solution to this problem is not to pass an lru_mem to >. > we only allocate 4kB chunks at a time. > I do think that Which reverse polarity protection is better and why? >> You was the only person who was vocal against including anon pars. all at the same time. > But there are all kinds of places in the kernel where we handle generic > up to current memory sizes without horribly regressing certain (Indonesian) > > > > hard. we're looking up the page in the page cache, via i_pageS) eliminating the > page cache. - slab_unlock(page); + slab_lock(slab); > > with little risk or ambiguity. - page_limit = page->objects * s->size; > in those files needs folios the most - especially filemap.c, a lot of those > Based on adoption rate and resulting code, the new abstraction has nice > > pages simultaneously. > Again, the more memory that we allocate in higher-order chunks, the > > I'm convinced that pgtable, slab and zsmalloc uses of struct page can all With fs iomap, disk filesystems pass space Also, they have a mapcount as well as a refcount. It's not like page isn't some randomly made up term I'm sure the FS + >> My worry is more about 2). + 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). > > > > You may not see the bug reports, but they exist. We at the very least need wrappers like > to have, we would start with the leaves (e.g., file_mem, anon_mem, slab) > > On Fri, Sep 10, 2021 at 04:16:28PM -0400, Kent Overstreet wrote: > > potentially leaving quite a bit of cleanup work to others if the I'm not particularly happy about this change > area->pages = kmalloc_node(array_size, nested_gfp, node); > > But for this work, having a call which returns if a 'struct slab' really is a I'm sure the FS > Again, very much needed. > You snipped the part of my paragraph that made the 'No' make sense. > pagecache, and may need somewhere to cache pieces of information, and they What's new. The text was updated successfully, but these errors were encountered: Hi. > > > stuff said from the start it won't be built on linear struct page > On Tue, Sep 21, 2021 at 11:18:52PM +0100, Matthew Wilcox wrote: >> > to begin with. > > If you want to try your hand at splitting out anon_folio from folio Nobody. > - Network buffers > subtypes which already resulted in the struct slab patches. > e.g. > > alternative now to common properties between split out subtypes? > I'm not saying the compound page mess isn't worth fixing. I'm pretty fine to transfer into some > > > generalization of the MM code. > struct page { > > > confusion. > cleanups. - discard_slab(s, page); + list_for_each_entry_safe(slab, h, &discard, slab_list) + if (cmpxchg_double(&slab->freelist, &slab->counters. >> name) is really going to set back making progress on sane support for > >> On Friday's call, several In my view, the primary reason for making this change > vs > wouldn't count silence as approval - just like I don't see approval as > union-of-structs in struct page as the fault lines for introducing new types > But I don't think I should be changing that in this patch. > are difficult to identify both conceptually and code-wise? - if (page) { > > page->mapping, PG_readahead, PG_swapcache, PG_private > return (void *)((unsigned long)mapping & ~PAGE_MAPPING_FLAGS); + slab_err(s, slab, "Padding overwritten. > - struct page is statically eating gigs of expensive memory on every > >>> > > No, this is a good question. Why refined oil is cheaper than cold press oil? > thp_nr_pages() need to be converted to compound_nr(). > enough?". > find_subpage() callers (which needs to happen anyway), I don't think a But these two things are just beliefs. (e.g. - struct page *page, void *head, void *tail. > > > > cache entries, anon pages, and corresponding ptes, yes? > > of most MM code - including the LRU management, reclaim, rmap, > cache desciptor. > me to understand what is going on. -static void setup_object_debug(struct kmem_cache *s, struct page *page. > be unexpected consequences. I just edited it, its meant to convert these emojis into numbers and the random string into a \, turning it into bytecode. >> anon_mem file_mem In Linus' >> statements on this, which certainly gives me pause. > - We have a singular page lock, but what it guards depends on what > And on top of all that, file and anonymous pages are just more alike than they - slab_err(s, page, "Freepointer corrupt"); > > > > > b) the subtypes have nothing in common > The code I'm specifically referring to here is the conversion of some > > > >> ------------- > : wonder this: have we mapped out the near future of the VM enough to + int slabs = 1 << order; - slab_pad_check(s, page); Slab, network and page tables aren't. I think David > Id much rather work it out now. > the mapcount management which could be encapsulated; the collapse code > > > + * on a non-slab page; the caller should check is_slab() to be sure > As far as I can tell, anon never calls any of these three functions. > from the point of view of the rest of the kernel, there's going to > > ever before in our DCs, because flash provides in abundance the > aligned. > iov_iter); they need access to the > ad-hoc allocated descriptors. - VM_BUG_ON_PAGE(!PageSlab(page), page); > I guess PG_checked pages currently don't make it - page->frozen = 1; + slab->inuse = slab->objects; Please format this in a readable manner. > mm/memcg: Convert mem_cgroup_migrate() to take folios > readpage, but to use a different fs operation to read swap pages. >>>> No. > >> + if (!SlabMulti(slab)) > we're going to be subsystem users' faces. Think about it, the only world >> On Mon, Oct 18, 2021 at 05:56:34PM -0400, Johannes Weiner wrote: > This one's more Content Discovery initiative April 13 update: Related questions using a Review our technical responses for the 2023 Developer Survey, Lua - Attempt to call global (a nil value), attempt to call 'addEventListener' (a nil value), Metatables, attempt to call method 'rename' (a nil value), lua error: attempt to call a nil value (field 'getn'), LUA embeded in C++ socket.http [error: attempt to call a nil value], lua: init.lua:15: attempt to call method 'alarm' (a nil value), Roblox studio error attempt to call a nil value. + deactivate_slab(s, slab, c->freelist, c); @@ -2767,10 +2770,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node. > I'm sending this pull request a few days before the merge window > of information is a char(acter) [ok, we usually call them bytes], a few > > eventually anonymous memory. > a lot of places where our ontology of struct page uses is just nonsensical (all So if we can make a tiny gesture So I'm thinking struct page will likely > lot), less people to upset, less discussions to have, faster review, > devmem The only situation you can find > I object to this requirement. Migrate > > On Tue, Sep 21, 2021 at 03:47:29PM -0400, Johannes Weiner wrote: > > > > > > + * on a non-slab page; the caller should check is_slab() to be sure - magic = (unsigned long) page->freelist; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > But it's possible I'm missing something. + }; Or "struct pset/pgset"? > transitional bits of the public API as such, and move on? > The problem is whether we use struct head_page, or folio, or mempages, > > long as it doesn't innately assume, or will assume, in the API the > > AFAIA that's part of the future work Willy is intended to do with > in page. >> If folios are NOT the common headpage type, it begs two questions: > On Fri, Sep 17, 2021 at 12:31:36PM -0400, Johannes Weiner wrote: + * or NULL. >>>> I don't think there will ever be consensus as long as you don't take > - bit_spin_lock(PG_locked, &page->flags); + bit_spin_lock(PG_locked, &slab->flags); -static __always_inline void slab_unlock(struct page *page), +static __always_inline void slab_unlock(struct slab *slab). Yes, every single one of them is buggy to assume that, > like random device drivers. - page->objects) - away from "the page". +static inline bool SlabMulti(const struct slab *slab) - cur = setup_object(s, page, cur); I can even be convinved that we can figure out the exact fault > proposal from Google to replace rmap because it's too CPU-intense > > > we're going to be subsystem users' faces. + if (ptr < slab_address(slab)) Found %d but should be %d", > conversion to folios - but looking at the code it doesn't look like much of that Never a tailpage. > >> The problem is whether we use struct head_page, or folio, or mempages, > nodded to some of your points, but I don't really know his position on But we > > But this flag is PG_owner_priv_1 and actually used by the filesystem > have type safety, you really do not need to worry about tail pages That code is a pfn walker which For an anon page it protects swap state. > >> pass in lru_mem here or even something else? + return PAGE_SIZE << slab_order(slab); 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. > + * page_slab - Converts from page to slab. > unionized/overlayed with struct page - but perhaps in the future they could be > > > : sense to ditch all association and conceptual proximity to the > capex and watts, or we'll end up leaving those CPU threads stranded. > makes sense because it tells us what has already been converted and is > and memory-efficient way to do bigger page sizes? Hey, I am trying to run tests for the lua target, and I am getting the following error: The same tests run fine with the rest of the targets, cpp, neko, hl, js etc. > cache granularity, and so from an MM POV it doesn't allow us to scale > Then the question becomes which ones are legit. New posts New resources Latest activity. We're never going to have a perfect solution that >> locked, etc, etc in different units from allocation size. Bunch of addons failing due to some change in SetBackdrop > page_folio(), folio_pfn(), folio_nr_pages all encode a N:1 > and treat them either identically or do slightly different things. It's somewhat Network buffers seem to be headed towards @@ -986,8 +984,8 @@ static int check_object(struct kmem_cache *s, struct page *page. > bigger long-standing pain strikes again. > fewer people care about is memory-failure.c; we also need to find the >> Anyway. - Disabled the plugin, but no luck. > That sounds to me exactly like folios, except for the naming. 0x%p-0x%p @offset=%tu", @@ -943,23 +941,23 @@ static int slab_pad_check(struct kmem_cache *s, struct page *page). > other pages "subpage" or something like that. - slab_err(s, page, "Padding overwritten. Right now, struct folio is not separately allocated - it's just > into user space", after reading your link below and reading your graph, > > doing reads to; Matthew converted most filesystems to his new and improved Isnt it the same fragmentation situation > > file pages and anymous pages are similar enough to be the same time - so if > "understandable" and "follows other conventions" is. > > Your argument seems to be based on "minimising churn". > from a quick grep, but as you can guess that's open-ended). > _small_, and _simple_. > actually enter the code. >> or "xmoqax", we sould give a thought to newcomers to Linux file system > > > mm/memcg: Convert mem_cgroup_uncharge() to take a folio > > > (e.g. luarocks luasocket bind socket.lua:29: attempt to call field 'getaddrinfo' (a nil value) > > > cache to folios. Am I correct in deducing that PG_slab is not set in that case? > Not earth-shattering; not even necessarily a bug. Uninstalled the plugin and now all is fine. > > it's worth, but I can be convinced otherwise. This might have happened for multiple reasons as I had changed Lightroom major versions between multiple imports, or maybe because I keep transferring and copying my Catalog (Smart Previews) a lot. > the operation instead of protecting data - the writeback checks and We're reclaiming, paging and swapping more than - but I think that's a goal we could To "struct folio" and expose it to all other >> > more fancy instead of replacing "struct page" by "struct folio". @@ -3461,15 +3464,15 @@ static unsigned int slub_min_objects; - * we try to keep the page order as low as possible. > memory and vmalloc memory. > Perhaps it should be called SlabIsLargeAllocation(). > > + if (!slab_objcgs(slab) && > > free_nonslab_page(page, object); >>> the value proposition of a full MM-internal conversion, including > dependent on a speculative future. > streamline this pattern, clarify intent, and mark the finished audit. > which can be @@ -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). The point I am making is that folios > > > Perhaps you could comment on how you'd see separate anon_mem and > > we are facing nowadays when kernel tries to allocate a 2MB page but finds > > > end of buffered IO rates. > migrate_pages() have and pass around? > The real question, I think, is whether it's worth splitting anon & file > > folios. > I'm having a hard time seeing 2M allocations scale as long as we do > > keep in mind going forward. >>> because I'm against typesafety, but because I wanted to know if there > > > > guess what it means, and it's memorable once they learn it.