linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Hillf Danton <dhillf@gmail.com>
Cc: Michel Lespinasse <walken@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH] ksm: use FAULT_FLAG_ALLOW_RETRY in breaking COW
Date: Mon, 21 Nov 2011 14:23:32 -0800 (PST)	[thread overview]
Message-ID: <alpine.LSU.2.00.1111211413460.1879@sister.anvils> (raw)
In-Reply-To: <CAJd=RBBa-ZoZ3GhYQ-aM=TJ9Zw6ZSu177PWw+s8+zyFnzyUV_w@mail.gmail.com>

On Mon, 21 Nov 2011, Hillf Danton wrote:
> On Mon, Nov 21, 2011 at 12:16 PM, Hugh Dickins <hughd@google.com> wrote:
> 
> After reading your reply and the comments in break_ksm(), if the patch does
> not mess up
> 	"The important thing is to not let VM_MERGEABLE be cleared while any
> 	 such pages might remain in the area",
> and
> 	"because handle_mm_fault() may back out if there's
> 	 any difficulty e.g. if pte accessed bit gets updated concurrently",
> 
> then if the path in which lock_page_or_retry() is called is not involved,
> mmap_sem is not upped, so the patch has nearly same behavior with break_ksm.
> 
> And the overhead of the patch, I think, could match break_ksm.
> 
> With dozen cases of writers of mmap_sem in the mm directory, the patch looks
> more flexible in rare and rare corners.

But what's the point in enlarging the kernel, adding code to make
break_cow() look more complicated, when there's no way in which the
addition can make an improvement?

Adding in a FAULT_FLAG_ALLOW_RETRY flag is not enough for mmap_sem
to be dropped for retry: you'd need a lock_page_or_retry() on the
faulting path and I do not see that here - please point it out to
me if you can see it.

(And I'll be somewhat sceptical if you respond with patches adding
lock_page_or_retry() all over, in order to meet this objection!)

Hugh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-11-21 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 11:50 Hillf Danton
2011-11-21  4:16 ` Hugh Dickins
2011-11-21 13:47   ` Hillf Danton
2011-11-21 22:23     ` Hugh Dickins [this message]
2011-11-22 13:04       ` Hillf Danton
2011-11-21 23:10 ` Michel Lespinasse

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=alpine.LSU.2.00.1111211413460.1879@sister.anvils \
    --to=hughd@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=walken@google.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