[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87fri9w0g2.fsf@oracle.com>
Date: Tue, 15 Apr 2025 14:59:25 -0700
From: Ankur Arora <ankur.a.arora@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Ankur Arora <ankur.a.arora@...cle.com>, Ingo Molnar <mingo@...nel.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, mingo@...hat.com,
luto@...nel.org, peterz@...radead.org, paulmck@...nel.org,
rostedt@...dmis.org, tglx@...utronix.de, jon.grimm@....com,
bharata@....com, raghavendra.kt@....com, boris.ostrovsky@...cle.com,
konrad.wilk@...cle.com
Subject: Re: [PATCH v3 1/4] x86/clear_page: extend clear_page*() for
multi-page clearing
Matthew Wilcox <willy@...radead.org> writes:
> On Mon, Apr 14, 2025 at 12:52:37PM -0700, Ankur Arora wrote:
>> Ingo Molnar <mingo@...nel.org> writes:
>> >> +void clear_pages_orig(void *page, unsigned int length);
>> >> +void clear_pages_rep(void *page, unsigned int length);
>> >> +void clear_pages_erms(void *page, unsigned int length);
>> >
>> > What unit is 'length' in? If it's bytes, why is this interface
>> > artificially limiting itself to ~4GB? On x86-64 there's very little (if
>>
>> I was in two minds about the unit. Given that the largest page size is
>> 1GB, decided to go with 32bit. But, as you say below, there's no reason
>> to limit the x86-64 interface for MM reasons. Will fix.
>
> Actually, I think there is (and we went through this with SPARC, if you
> remember?)
My google-fu is failing me. I don't think it was this thread:
https://lore.kernel.org/lkml/1490310113-824438-1-git-send-email-pasha.tatashin@oracle.com/
> We _shouldn't_ be calling memset() with a large size (ie
> larger than 4GB). If we have that much memory to clear, we should be
> doing something smarter, like using padata to get lots of CPUs clearing
> individual portions of the page.
Agreed. Or even offloading to an accelerator so as to not waste CPU time.
That said, whether to invoke clear_pages() in > 4GB seems like an MM
policy question. Not sure it makes sense to limit the low level interface.
> I don't know how relevant this is now that you're going to be using
> ALTERNATIVES.
--
ankur
Powered by blists - more mailing lists