linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Pavan Kondeti <quic_pkondeti@quicinc.com>, <osalvador@suse.de>,
	<dan.j.williams@intel.com>, <david@redhat.com>, <vbabka@suse.cz>,
	<mgorman@techsingularity.net>, <aneesh.kumar@linux.ibm.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/sparsemem: fix race in accessing memory_section->usage
Date: Wed, 25 Oct 2023 14:35:41 -0700	[thread overview]
Message-ID: <20231025143541.e7cf114239b84105711a5f70@linux-foundation.org> (raw)
In-Reply-To: <b4a2bbe8-4181-68ad-1a6c-463fbe64d8f8@quicinc.com>

On Tue, 17 Oct 2023 19:40:15 +0530 Charan Teja Kalla <quic_charante@quicinc.com> wrote:

> >>  		 * was allocated during boot.
> >>  		 */
> >>  		if (!PageReserved(virt_to_page(ms->usage))) {
> >> +			synchronize_rcu();
> >>  			kfree(ms->usage);
> >>  			ms->usage = NULL;
> >>  		}
> > If we add NULL checks around ms->usage, this becomes
> > 
> > tmp = rcu_replace_pointer(ms->usage, NULL, hotplug_locked());
> > syncrhonize_rcu();
> > kfree(tmp);
> Per David input, I am working on using kfree_rcu().

How's it coming along?

Given that we're at 6.6-rc7 and given that this issue is causing
daily crashes in your device farm, I'm thinking that we use the current
version of your patch for 6.6 and for -stable.  We can look at the
kfree_rcu() optimization for later kernel releases?


  parent reply	other threads:[~2023-10-25 21:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 13:04 Charan Teja Kalla
2023-10-14 22:25 ` Andrew Morton
2023-10-16  8:23   ` David Hildenbrand
2023-10-16 13:38     ` Charan Teja Kalla
2023-10-16 22:34       ` Andrew Morton
2023-10-18  7:52       ` David Hildenbrand
2023-10-16 10:33 ` Pavan Kondeti
2023-10-17 14:10   ` Charan Teja Kalla
2023-10-17 14:53     ` David Hildenbrand
2023-10-25 21:35     ` Andrew Morton [this message]
2023-10-26  7:00       ` David Hildenbrand
2023-10-26  7:18         ` Charan Teja Kalla
2024-01-15 18:44 ` Alexander Potapenko
2024-01-15 20:34   ` Marco Elver
2024-01-17 19:18     ` Marco Elver
2024-01-18  9:01       ` Alexander Potapenko
2024-01-18  9:43         ` Marco Elver
2024-01-25 13:20           ` Paul E. McKenney

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=20231025143541.e7cf114239b84105711a5f70@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=osalvador@suse.de \
    --cc=quic_charante@quicinc.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=vbabka@suse.cz \
    /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