Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303025

Re: [PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap semaphore taken.

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Mateusz Guzik <mguzik@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap semaphore taken.
Date Wed, 06 Jan 2016 20:50:02 +0100
Message-ID <qO2fM-5vA-5@gated-at.bofh.it> (permalink)
References <qNOwa-546-7@gated-at.bofh.it> <qNOwa-546-11@gated-at.bofh.it> <qNST9-7Lj-15@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
User-Agent Mutt/1.5.23.1 (2014-03-12)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.27
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexey Dobriyan <adobriyan@gmail.com>, Cyrill Gorcunov <gorcunov@openvz.org>, Jarod Wilson <jarod@redhat.com>, Jan Stancek <jstancek@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Al Viro <viro@zeniv.linux.org.uk>
X-Original-Date Wed, 6 Jan 2016 20:43:31 +0100
X-Original-Message-ID <20160106194329.GB14492@mguzik>
X-Original-References <1452056549-10048-1-git-send-email-mguzik@redhat.com> <1452056549-10048-3-git-send-email-mguzik@redhat.com> <CAKeScWjvz7Bja6wMw5euWNWYdZ5_ikEdgR1Qk77pcCFajHmbeQ@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1303025

Show key headers only | View raw


On Wed, Jan 06, 2016 at 03:14:22PM +0530, Anshuman Khandual wrote:
> On Wed, Jan 6, 2016 at 10:32 AM, Mateusz Guzik <mguzik@redhat.com> wrote:
> > Only functions doing more than one read are modified. Consumeres
> > happened to deal with possibly changing data, but it does not seem
> > like a good thing to rely on.
> 
> There are no other functions which might be reading mm-> members without
> having a lock ? Why just deal with functions with more than one read ?

Ideally all functions would read stuff with some kind of lock.

However, if only one field is read, the lock does not change anything.
Similarly, if multiple fields are read, but are not used for
calculations against each other, the lock likely does not change
anything, so there is no rush here.

Using mmap_sem in all places may or may not be possible as it is, and
even if it is possible it may turn out to be wasteful and maybe
something else should be derived for protection of said fields (maybe a
seq counter?).

That said, patches here only deal with one actual I found and patch up
consumers which had the most potential for trouble. Patching everything
in some way definitely sounds like a good idea and I may get around to
that.

-- 
Mateusz Guzik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap semaphore taken. Mateusz Guzik <mguzik@redhat.com> - 2016-01-06 06:10 +0100
  Re: [PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap  semaphore taken. Anshuman Khandual <anshuman.linux@gmail.com> - 2016-01-06 10:50 +0100
    Re: [PATCH 2/2] proc read mm's {arg,env}_{start,end} with mmap  semaphore taken. Mateusz Guzik <mguzik@redhat.com> - 2016-01-06 20:50 +0100

csiph-web