linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jane Chu <jane.chu@oracle.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org
Cc: Joao Martins <joao.m.martins@oracle.com>,
	Muchun Song <songmuchun@bytedance.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Tarun Sahu <tsahu@linux.ibm.com>
Subject: Re: [PATCH] mm/vmemmap/devdax: Fix kernel crash when probing devdax devices
Date: Fri, 7 Apr 2023 11:03:51 -0700	[thread overview]
Message-ID: <c13809d9-ed2c-b674-27ab-f023fca12e6c@oracle.com> (raw)
In-Reply-To: <20230407122353.12018-1-aneesh.kumar@linux.ibm.com>

On 4/7/2023 5:23 AM, Aneesh Kumar K.V wrote:
> diff --git a/mm/Kconfig b/mm/Kconfig
> index ff7b209dec05..99f87c1be1e8 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -461,6 +461,9 @@ config SPARSEMEM_VMEMMAP
>   	  pfn_to_page and page_to_pfn operations.  This is the most
>   	  efficient option when sufficient kernel resources are available.
>   
> +config ARCH_WANT_OPTIMIZE_VMEMMAP
> +	bool
> +

Could this devdax specific config switch be added to drivers/dax/Kconfig 
? also, how about adding 'DAX' to the config switch name?

BTW, I noticed something minor and unrelated in the original commit 
(c4386bd8ee3a):

-static unsigned long pfn_next(unsigned long pfn)
+static unsigned long pfn_next(struct dev_pagemap *pgmap, unsigned long pfn)
  {
-       if (pfn % 1024 == 0)
+       if (pfn % (1024 << pgmap->vmemmap_shift))     <---- this line
                 cond_resched();
-       return pfn + 1;
+       return pfn + pgmap_vmemmap_nr(pgmap);
+}

should be
+       if (pfn % (1024 * pgmap_vmemmap_nr(pgmap))
to be consistent.

thanks,
-jane



  reply	other threads:[~2023-04-07 18:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 12:23 Aneesh Kumar K.V
2023-04-07 18:03 ` Jane Chu [this message]
2023-04-08 10:19   ` Aneesh Kumar K.V
2023-04-10 17:27     ` Jane Chu
2023-04-10 17:47       ` Joao Martins
2023-04-10 21:39         ` Jane Chu
2023-04-10 22:55           ` Joao Martins
2023-04-09  2:00 ` Dan Williams
2023-04-10 10:33 ` Joao Martins
2023-04-11  8:07   ` Aneesh Kumar K.V
2023-04-11 10:33     ` Joao Martins

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=c13809d9-ed2c-b674-27ab-f023fca12e6c@oracle.com \
    --to=jane.chu@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=joao.m.martins@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=songmuchun@bytedance.com \
    --cc=tsahu@linux.ibm.com \
    /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