linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Mateusz Guzik <mguzik@redhat.com>
Cc: Yang Shi <yang.shi@linux.alibaba.com>,
	adobriyan@gmail.com, willy@infradead.org, gorcunov@openvz.org,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [v2 PATCH] mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct
Date: Tue, 27 Mar 2018 16:43:20 +0200	[thread overview]
Message-ID: <20180327144320.GI5652@dhcp22.suse.cz> (raw)
In-Reply-To: <20180327143122.rjgxjoj2adzvfck2@mguzik>

On Tue 27-03-18 16:31:23, Mateusz Guzik wrote:
> On Tue, Mar 27, 2018 at 08:29:39AM +0200, Michal Hocko wrote:
> > On Tue 27-03-18 02:20:39, Yang Shi wrote:
> > [...]
> > The patch looks reasonable to me. Maybe it would be better to be more
> > explicit about the purpose of the patch. As others noticed, this alone
> > wouldn't solve the mmap_sem contention issues. I _think_ that if you
> > were more explicit about the mmap_sem abuse it would trigger less
> > questions.
> > 
> 
> >From what I gather even with other fixes the kernel will still end up
> grabbing the semaphore. In this case I don't see what's the upside of
> adding the spinlock for args. The downside is growth of mm_struct.

Because accessing the specific address in the address space can be later
changed to use a more fine-grained locking. There are people
experimenting with range locking. These mmap_sem abusers, on the other
hand, will require the full range lock without a good reason. So it is
really worth it to remove them and replace by a more fine grained
locking.

If the mm_struct grow is a real concern (I haven't checked that) then we
can use a set of hashed locks or something else.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-03-27 14:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 18:20 [v2 PATCH] mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct Yang Shi
2018-03-26 18:37 ` Matthew Wilcox
2018-03-26 19:21   ` Cyrill Gorcunov
2018-03-26 21:10     ` Tetsuo Handa
2018-03-26 21:20       ` Yang Shi
2018-03-26 21:29       ` Cyrill Gorcunov
2018-03-26 22:00         ` Tetsuo Handa
2018-03-26 22:12           ` Yang Shi
2018-03-27  7:38             ` Cyrill Gorcunov
2018-03-27  7:37           ` Cyrill Gorcunov
2018-03-26 21:59     ` Yang Shi
2018-03-27  7:32       ` Cyrill Gorcunov
2018-03-27 18:44         ` Yang Shi
2018-03-26 19:42 ` Mateusz Guzik
2018-03-26 21:10   ` Yang Shi
2018-03-27  6:29 ` Michal Hocko
2018-03-27 14:31   ` Mateusz Guzik
2018-03-27 14:43     ` Michal Hocko [this message]
2018-03-27 18:38   ` Yang Shi
2018-03-27 18:52     ` Cyrill Gorcunov
2018-03-28 13:10       ` Michal Hocko
2018-04-02  1:58   ` Yang Shi

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=20180327144320.GI5652@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mguzik@redhat.com \
    --cc=willy@infradead.org \
    --cc=yang.shi@linux.alibaba.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).