[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210614070441.GA3801@lespinasse.org>
Date: Mon, 14 Jun 2021 00:04:41 -0700
From: Michel Lespinasse <michel@...pinasse.org>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: "Paul E . McKenney" <paulmck@...nel.org>,
Michel Lespinasse <michel@...pinasse.org>,
Linux-MM <linux-mm@...ck.org>,
Linux-Kernel <linux-kernel@...r.kernel.org>,
Laurent Dufour <ldufour@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Michal Hocko <mhocko@...e.com>,
Matthew Wilcox <willy@...radead.org>,
Rik van Riel <riel@...riel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Joel Fernandes <joelaf@...gle.com>,
Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH 00/29] Speculative page faults (anon vmas only)
On Thu, May 20, 2021 at 03:10:24PM -0700, Suren Baghdasaryan wrote:
> Hi Paul,
> I promised you to look into this but somehow forgot to reply, sorry
> about that. The issue is the new "#include <linux/mm_types.h>" in mm.h
> which causes page_pgdat() usage before it is defined:
Yes. This only happens in non-memcg configs, which is why I hadn't
found it in testing.
>
> mm.h includes mm_types.h
> mm_types.h includes vmstat.h
> vmstat.h uses page_pgdat()
> mm.h defines page_pgdat()
>
> Not sure if this is the best way to fix it but this worked fine for me:
>
> ---
> include/linux/mmap_lock.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
> index 98f24a9910a9..13d4a706c0eb 100644
> --- a/include/linux/mmap_lock.h
> +++ b/include/linux/mmap_lock.h
> @@ -7,7 +7,7 @@
> #include <linux/rwsem.h>
> #include <linux/tracepoint-defs.h>
> #include <linux/types.h>
> -#include <linux/vmstat.h>
> +#include <linux/vm_event_item.h>
>
> #ifdef CONFIG_SPECULATIVE_PAGE_FAULT
> #define MMAP_LOCK_SEQ_INITIALIZER(name) \
> @@ -113,6 +113,8 @@ static inline bool __mmap_seq_read_check(struct
> mm_struct *mm,
> }
>
> #ifdef CONFIG_SPECULATIVE_PAGE_FAULT_STATS
> +static inline void count_vm_event(enum vm_event_item item);
> +
> static inline bool mmap_seq_read_check(struct mm_struct *mm, unsigned long seq,
> enum vm_event_item fail_event)
> {
I think having only the count_vm_event() prototype may cause it to not
actually get inlined when we want it ?
I think it would be ideal to have a separate linux/vm_event.h header,
with just the definitions that are currently in linux/vmstat.h
between "#ifdef CONFIG_VM_EVENT_COUNTERS" and up to (and including)
the __count_vm_events() definition (i.e., functions that just increment
the percpu event counters). Then mmap_lock.h could use that instead of
the full vmstat.h.
--
Michel "walken" Lespinasse
Powered by blists - more mailing lists