linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Huang Ying <ying.huang@intel.com>,
	Jin Dongming <jin.dongming@np.css.fujitsu.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] Check whether pages are poisoned before copying
Date: Thu, 17 Mar 2011 15:04:01 +0100	[thread overview]
Message-ID: <20110317140401.GX10696@random.random> (raw)
In-Reply-To: <4D81BB87.10803@jp.fujitsu.com>

Hello Hidetoshi,

On Thu, Mar 17, 2011 at 04:43:03PM +0900, Hidetoshi Seto wrote:
> Still I think making the window smaller than now is worthwhile,
> no matter it is change from 0.1% to 0.01%, or from 0.01% to 0.001%.
> 
> Or did you find the downside of the check here?

Well it makes the code more a little more complicated for something
that looks impossible to trigger in the first place.

The slowdown of these changes is probably not significant because the
2m copy should dominate the collapse_huge_page cost, but it still add
locked ops and loops that weren't there before so technically it is a
microslowdown.

NOTE: if this closed the race window 100% I would not disagree with
this. If there's still a 0.001% chance of hitting the race like Andi
hints, then I don't find it very attractive. I think memory failure
isn't 100% correct and probably it's impossible to make it 100%
correct across the whole kernel (for example the compound_head is safe
for THP but it's still unsafe for hugetlbfs while the page is being
tear down), so it's probably ok that it tends to work in practice 100%
reliably when the task is running in userland but we leave holes when
kernel is mangling the page structures and moving stuff around,
otherwise we litter the kernel code without much practical benefit, I
guess KSM has the same issues of khugepaged for example.

So again, I'm not against making these changes, but I don't find them
very attractive and I'm unsure if we should go down this route
whenever the objective of the patch is only to reduce the race window
(that is incredibly small and not reproducible to start with, and it's
a theoretical race that hardly anybody could trigger) instead of
actually closing the race completely. But thanks a lot for your
effort, I see your point, I'm just not sure if it's worth it. I think
I'll let other comments on this...

  reply	other threads:[~2011-03-17 14:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17  2:30 [PATCH 0/4] THP: page collapsing vs. poisoning Hidetoshi Seto
2011-03-17  2:31 ` [PATCH 1/4] Lock the new THP when collapsing pages Hidetoshi Seto
2011-03-17  2:32 ` [PATCH 2/4] Free the collapsed pages after the new THP is mapped Hidetoshi Seto
2011-03-17  2:32 ` [PATCH 3/4] Check whether pages are poisoned before copying Hidetoshi Seto
2011-03-17  4:14   ` Andi Kleen
2011-03-17  5:20     ` Hidetoshi Seto
2011-03-17  6:26       ` Andi Kleen
2011-03-17  7:43         ` Hidetoshi Seto
2011-03-17 14:04           ` Andrea Arcangeli [this message]
2011-03-17 15:25             ` Andi Kleen
2011-03-17 16:12               ` Andrea Arcangeli
2011-03-17 16:27                 ` Andi Kleen
2011-03-17 16:47                   ` Andrea Arcangeli
2011-03-17 22:55                     ` Andi Kleen
2011-03-23 17:26             ` K.Prasad
2011-03-23 17:32               ` Andi Kleen
2011-03-17 15:21           ` Andi Kleen
2011-03-18  5:26             ` Jin Dongming
2011-03-17  2:33 ` [PATCH 4/4] Check whether the new THP is poisoned before it is mapped to APL Hidetoshi Seto

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=20110317140401.GX10696@random.random \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=jin.dongming@np.css.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=ying.huang@intel.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;
as well as URLs for NNTP newsgroup(s).