From: Marcelo Tosatti <mtosatti@redhat.com>
To: Nicolas Saenz Julienne <nsaenzju@redhat.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, frederic@kernel.org, tglx@linutronix.de,
mgorman@suse.de, linux-rt-users@vger.kernel.org, vbabka@suse.cz,
cl@linux.com, paulmck@kernel.org, willy@infradead.org
Subject: Re: [PATCH 1/2] mm/page_alloc: Access lists in 'struct per_cpu_pages' indirectly
Date: Thu, 3 Mar 2022 11:33:50 -0300 [thread overview]
Message-ID: <YiDRzgYkYV51TAGJ@fuller.cnet> (raw)
In-Reply-To: <20220208100750.1189808-2-nsaenzju@redhat.com>
On Tue, Feb 08, 2022 at 11:07:49AM +0100, Nicolas Saenz Julienne wrote:
> In preparation to adding remote per-cpu page list drain support, let's
> bundle 'struct per_cpu_pages's' page lists and page count into a new
> structure: 'struct pcplists', and have all code access it indirectly
> through a pointer. It'll be used by upcoming patches in order to
> maintain multiple instances of 'pcplists' and switch the pointer
> atomically.
>
> The 'struct pcplists' instance lives inside 'struct per_cpu_pages', and
> shouldn't be accessed directly. It is setup as such since these
> structures are used during early boot when no memory allocation is
> possible and to simplify memory hotplug code paths.
>
> free_pcppages_bulk() and __rmqueue_pcplist()'s function signatures
> change a bit so as to accommodate these changes without affecting
> performance.
>
> No functional change intended.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
> ---
>
> Changes since RFC:
> - Add more info in commit message.
> - Removed __private attribute, in hindsight doesn't really fit what
> we're doing here.
> - Use raw_cpu_ptr() where relevant to avoid warnings.
>
> include/linux/mmzone.h | 10 +++--
> mm/page_alloc.c | 87 +++++++++++++++++++++++++-----------------
> mm/vmstat.c | 6 +--
> 3 files changed, 62 insertions(+), 41 deletions(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 3fff6deca2c0..b4cb85d9c6e8 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -381,7 +381,6 @@ enum zone_watermarks {
>
> /* Fields and list protected by pagesets local_lock in page_alloc.c */
> struct per_cpu_pages {
> - int count; /* number of pages in the list */
> int high; /* high watermark, emptying needed */
> int batch; /* chunk size for buddy add/remove */
> short free_factor; /* batch scaling factor during free */
> @@ -389,8 +388,13 @@ struct per_cpu_pages {
> short expire; /* When 0, remote pagesets are drained */
> #endif
>
> - /* Lists of pages, one per migrate type stored on the pcp-lists */
> - struct list_head lists[NR_PCP_LISTS];
> + struct pcplists *lp;
> + struct pcplists {
> + /* Number of pages in the pcplists */
> + int count;
> + /* Lists of pages, one per migrate type stored on the pcp-lists */
> + struct list_head lists[NR_PCP_LISTS];
> + } __pcplists; /* Do not access directly */
> };
Perhaps its useful to add something like: "should be acessed through ..."
Looks good otherwise.
next prev parent reply other threads:[~2022-03-03 15:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 10:07 [PATCH 0/2] mm/page_alloc: Remote per-cpu lists drain support Nicolas Saenz Julienne
2022-02-08 10:07 ` [PATCH 1/2] mm/page_alloc: Access lists in 'struct per_cpu_pages' indirectly Nicolas Saenz Julienne
2022-03-03 14:33 ` Marcelo Tosatti [this message]
2022-02-08 10:07 ` [PATCH 2/2] mm/page_alloc: Add remote draining support to per-cpu lists Nicolas Saenz Julienne
2022-02-08 15:47 ` Marcelo Tosatti
2022-02-15 8:47 ` Nicolas Saenz Julienne
2022-02-15 17:32 ` Paul E. McKenney
2022-02-09 8:55 ` [PATCH 0/2] mm/page_alloc: Remote per-cpu lists drain support Xiongfeng Wang
2022-02-09 9:45 ` Nicolas Saenz Julienne
2022-02-09 11:26 ` Xiongfeng Wang
2022-02-09 11:36 ` Nicolas Saenz Julienne
2022-02-10 10:59 ` Xiongfeng Wang
2022-02-10 11:04 ` Nicolas Saenz Julienne
2022-03-03 11:45 ` Mel Gorman
2022-03-07 13:57 ` Nicolas Saenz Julienne
2022-03-10 16:31 ` Mel Gorman
2022-03-07 20:47 ` Marcelo Tosatti
2022-03-24 18:59 ` Nicolas Saenz Julienne
2022-03-25 10:48 ` Mel Gorman
2022-03-28 13:51 ` Nicolas Saenz Julienne
2022-03-29 9:45 ` Mel Gorman
2022-03-30 11:29 ` Nicolas Saenz Julienne
2022-03-31 15:24 ` Mel Gorman
2022-03-03 13:27 ` Vlastimil Babka
2022-03-03 14:10 ` Nicolas Saenz Julienne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YiDRzgYkYV51TAGJ@fuller.cnet \
--to=mtosatti@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=nsaenzju@redhat.com \
--cc=paulmck@kernel.org \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox