All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Chen Gang <xili_gchen_5257@hotmail.com>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"riel@redhat.com" <riel@redhat.com>,
	Michal Hocko <mhocko@suse.cz>,
	"oleg@redhat.com" <oleg@redhat.com>,
	"asha.levin@oracle.com" <asha.levin@oracle.com>,
	"pfeiner@google.com" <pfeiner@google.com>,
	"vishnu.ps@samsung.com" <vishnu.ps@samsung.com>,
	Linux Memory <linux-mm@kvack.org>,
	kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/mmap.c: Remove redundant vma looping
Date: Sun, 4 Oct 2015 19:26:45 +0200	[thread overview]
Message-ID: <20151004172645.GO19466@redhat.com> (raw)
In-Reply-To: <BLU436-SMTP233624CAE8A4C054B5DFFF8B9490@phx.gbl>

Hello Chen,

On Sun, Oct 04, 2015 at 12:55:29PM +0800, Chen Gang wrote:
> Theoretically, the lock and unlock need to be symmetric, if we have to
> lock f_mapping all firstly, then lock all anon_vma, probably, we also
> need to unlock anon_vma all, then unlock all f_mapping.

They don't need to be symmetric because the unlocking order doesn't
matter. To avoid lock inversion deadlocks it is enough to enforce the
lock order.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <aarcange@redhat.com>
To: Chen Gang <xili_gchen_5257@hotmail.com>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"riel@redhat.com" <riel@redhat.com>,
	Michal Hocko <mhocko@suse.cz>,
	"oleg@redhat.com" <oleg@redhat.com>,
	"asha.levin@oracle.com" <asha.levin@oracle.com>,
	"pfeiner@google.com" <pfeiner@google.com>,
	"vishnu.ps@samsung.com" <vishnu.ps@samsung.com>,
	Linux Memory <linux-mm@kvack.org>,
	kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/mmap.c: Remove redundant vma looping
Date: Sun, 4 Oct 2015 19:26:45 +0200	[thread overview]
Message-ID: <20151004172645.GO19466@redhat.com> (raw)
In-Reply-To: <BLU436-SMTP233624CAE8A4C054B5DFFF8B9490@phx.gbl>

Hello Chen,

On Sun, Oct 04, 2015 at 12:55:29PM +0800, Chen Gang wrote:
> Theoretically, the lock and unlock need to be symmetric, if we have to
> lock f_mapping all firstly, then lock all anon_vma, probably, we also
> need to unlock anon_vma all, then unlock all f_mapping.

They don't need to be symmetric because the unlocking order doesn't
matter. To avoid lock inversion deadlocks it is enough to enforce the
lock order.

  reply	other threads:[~2015-10-04 17:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 19:38 [PATCH] mm/mmap.c: Remove redundant vma looping Chen Gang
2015-10-03 20:09 ` Richard Weinberger
2015-10-03 20:09   ` Richard Weinberger
2015-10-04  4:55   ` Chen Gang
2015-10-04  4:55     ` Chen Gang
2015-10-04 17:26     ` Andrea Arcangeli [this message]
2015-10-04 17:26       ` Andrea Arcangeli
2015-10-05 12:23       ` Chen Gang
2015-10-05 12:23         ` Chen Gang

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=20151004172645.GO19466@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=asha.levin@oracle.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=oleg@redhat.com \
    --cc=pfeiner@google.com \
    --cc=richard.weinberger@gmail.com \
    --cc=riel@redhat.com \
    --cc=vishnu.ps@samsung.com \
    --cc=xili_gchen_5257@hotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.