linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] mm/hwpoison: fix potential pte_unmap_unlock pte error
Date: Tue, 17 Aug 2021 23:37:01 +0000	[thread overview]
Message-ID: <20210817233701.GA485476@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <4b0a5fcd-0b1b-6198-b6a7-d9cab5b9fae2@huawei.com>

On Tue, Aug 17, 2021 at 04:24:43PM +0800, Miaohe Lin wrote:
> On 2021/8/17 15:29, HORIGUCHI NAOYA(堀口 直也) wrote:
...
> > One question is that according to "grep -r pte_unmap_unlock ." command over
> > whole kernel source code, pte_unmap_unlock() is called with "ptep - 1" in some places.
> > I think that none of them seems to have "break in for loop" in locked period,
> > so the same problem does not occur there.  But I'm still not sure why some place
> > call with "ptep - 1" and the others call with pte returned by pte_offset_map_lock().
> 
> IMO pte_unmap_unlock() works as long as the passed in pte belongs to the same page returned
> from pte_offset_map_lock(). I have fixed some similar place where pte_unmap_unlock() is called
> with wrong "ptep - 1" when I was learning the related mm code.

Great, thanks for clarification.

- Naoya

  reply	other threads:[~2021-08-17 23:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 10:51 [PATCH 0/4] Cleanups and fixup for memcontrol Miaohe Lin
2021-08-14 10:51 ` [PATCH 1/4] mm/hwpoison: remove unneeded variable unmap_success Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 10:51 ` [PATCH 2/4] mm/hwpoison: fix potential pte_unmap_unlock pte error Miaohe Lin
2021-08-17  7:29   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-17  8:24     ` Miaohe Lin
2021-08-17 23:37       ` HORIGUCHI NAOYA(堀口 直也) [this message]
2021-08-14 10:51 ` [PATCH 3/4] mm/hwpoison: change argument struct page **hpagep to *hpage Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 10:51 ` [PATCH 4/4] mm/hwpoison: fix some obsolete comments Miaohe Lin
2021-08-17  7:28   ` HORIGUCHI NAOYA(堀口 直也)
2021-08-14 11:00 ` [PATCH 0/4] Cleanups and fixup for memcontrol Miaohe Lin

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=20210817233701.GA485476@hori.linux.bs1.fc.nec.co.jp \
    --to=naoya.horiguchi@nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).