linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
Cc: Yin Fengwei <fengwei.yin@intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	Sidhartha Kumar <sidhartha.kumar@oracle.com>,
	Jane Chu <jane.chu@oracle.com>
Subject: Re: [PATCH 1/5] rmap: move hugetlb try_to_unmap to dedicated function
Date: Fri, 24 Feb 2023 11:21:30 -0800	[thread overview]
Message-ID: <Y/kOOmgCYQf7LjMX@monkey> (raw)
In-Reply-To: <20230224025119.GA1911853@hori.linux.bs1.fc.nec.co.jp>

On 02/24/23 02:51, HORIGUCHI NAOYA(堀口 直也) wrote:
> On Thu, Feb 23, 2023 at 05:28:10PM +0000, Matthew Wilcox wrote:
> > On Thu, Feb 23, 2023 at 04:31:56PM +0800, Yin Fengwei wrote:
> > > +
> > > +	if (folio_test_hwpoison(folio) && !(flags & TTU_IGNORE_HWPOISON)) {
> > > +		pteval = swp_entry_to_pte(make_hwpoison_entry(&folio->page));
> > > +		set_huge_pte_at(mm, address, pvmw.pte, pteval);
> > > +	}
> > > +
> > > +	/*** try_to_unmap_one() called dec_mm_counter for
> > > +	 * (folio_test_hwpoison(folio) && !(flags & TTU_IGNORE_HWPOISON)) not
> > > +	 * true case, looks incorrect. Change it to hugetlb_count_sub() here.
> > > +	 */
> > > +	hugetlb_count_sub(folio_nr_pages(folio), mm);
> 
> I have no objection to this change (moving hugetlb_count_sub() outside the
> if), but I have a question related to this.
> 
> Generally TTU_IGNORE_HWPOISON is used to control the pte-conversion based
> on page dirtiness.  But actually what it depends on is whether data lost
> happens when the page is forcibly dropped.  And for hugetlb pages, that's
> true regardless of PageDirty flag on it.
> So I think we can assume that try_to_unmap_one_hugetlb() is called with
> TTU_IGNORE_HWPOISON clear.  So maybe we don't need the if-check?

Thanks for looking at this Naoya!

In another reply I asked about the possibility of that if statement ever
being false for hugetlb pages.  Looks like that can never happen.  I went
back and looked at the memory failure/poison code just to be sure.

Yin,
Since we NEVER took went down the (folio_test_hwpoison(folio) &&
!(flags & TTU_IGNORE_HWPOISON)) not true path in the current code,
perhaps we not need the comment possibly calling dec_mm_counter. 
-- 
Mike Kravetz


  parent reply	other threads:[~2023-02-24 19:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  8:31 [PATCH 0/5] batched remove rmap in try_to_unmap_one() Yin Fengwei
2023-02-23  8:31 ` [PATCH 1/5] rmap: move hugetlb try_to_unmap to dedicated function Yin Fengwei
2023-02-23 17:28   ` Matthew Wilcox
2023-02-24  0:20     ` Mike Kravetz
2023-02-24  0:52       ` Yin, Fengwei
2023-02-24  2:51     ` HORIGUCHI NAOYA(堀口 直也)
2023-02-24  4:41       ` Yin, Fengwei
2023-02-24 19:21       ` Mike Kravetz [this message]
2023-02-26 11:44         ` Yin, Fengwei
2023-02-23  8:31 ` [PATCH 2/5] rmap: move page unmap operation " Yin Fengwei
2023-02-23  8:31 ` [PATCH 3/5] rmap: cleanup exit path of try_to_unmap_one_page() Yin Fengwei
2023-02-23  8:31 ` [PATCH 4/5] rmap:addd folio_remove_rmap_range() Yin Fengwei
2023-02-23  8:32 ` [PATCH 5/5] try_to_unmap_one: batched remove rmap, update folio refcount Yin Fengwei

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=Y/kOOmgCYQf7LjMX@monkey \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengwei.yin@intel.com \
    --cc=jane.chu@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=sidhartha.kumar@oracle.com \
    --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;
as well as URLs for NNTP newsgroup(s).