Received: by 10.213.65.68 with SMTP id h4csp955070imn; Tue, 27 Mar 2018 11:53:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xsdGL4//h7FrQqr83uoUEbnEBqt6vRRSEuwzF9Zdu7bz+ZrNaPLLoV14K4Efswd3/K/MF X-Received: by 10.99.135.199 with SMTP id i190mr341364pge.2.1522176811355; Tue, 27 Mar 2018 11:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522176811; cv=none; d=google.com; s=arc-20160816; b=kvskwMk4GWRIIAFgW+/jLXFyeUb0VScODTFmGopczTzBDI3PWPBpczA4rU7IAZoaiY x133xKSelC/lLb0XROAnqRDsyyLroeowJWT2S4OTHUpTWTAn6NTedWhEZn8W3AypCgMD sYn2ZRi8DY9Z3wH822FZl4C8KS7m/EUGbu9hKOytsWvnua3lAjiwNmVmQtUOFtcfirzR 0Giy4yv9OuoGxJJEuhaFkjWVOrEFRLp3h8EbnuJlbcvCHILUgRGFqn5etl/aeVagE0/P B7ILQ3/m/fpoNe6qPaeVrb5UmIqREKgjdjZb+24K25cTbBQISxX9ybRdRcgjBh+isoJi Jj9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=19YQ8StdkncwPnXni/oVwNkX1K4n6ibv08SiiaiztbI=; b=Jl46wBSYCDaUimqSAo4HN6nyV+hJb8o6hms4tt1ZPCIUppqfsl0Y95HP4otE6KojbK jxajT2PEegmzp6JJh6xLV0W410a3yA8qqyhnG4ZfZyNhwgaTrv9MwapbirtQ2+vVNyGb 6wiYmsd6d1lHS1N4VZVs986jID+tw0uDANhjIQRKQ+1YVbNDjAK6S+YNIkshfrvVAgca MO0wXJFtjBDEpimMbplhapIyeOG7UGOkSdTAunlwOSoj9VVsrvpE+tX1sAAgyhjecHMR NzSDU4WGy2Q7SD6TBKAah0AKQIqRLgs4N/F7UxvAvFNiqAINjK6hHRo23aYSb9WiGEoC X2QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdSo9+PC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si1259495pgs.761.2018.03.27.11.53.16; Tue, 27 Mar 2018 11:53:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdSo9+PC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbeC0SwY (ORCPT + 99 others); Tue, 27 Mar 2018 14:52:24 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:39825 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997AbeC0SwU (ORCPT ); Tue, 27 Mar 2018 14:52:20 -0400 Received: by mail-lf0-f49.google.com with SMTP id p142-v6so34795886lfd.6 for ; Tue, 27 Mar 2018 11:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=19YQ8StdkncwPnXni/oVwNkX1K4n6ibv08SiiaiztbI=; b=FdSo9+PCwQq3LxRMJRRoxdK20szHn3mdfLQsgmmZJz8+sYqP94P2/1WVFkoSXQFE+H OZ96luX4fI7hcreLp5kowIW8zp5d2byAeLqtv4K8apOQZW3D5Sz9qu9LnD+mAH2Uhz4z 1YZ2vl/KHPxgxaH5N3gVPtuavimFPz2RDfgw1vqo2tvEhH/1P9QMxmMXbQ2WGjwQf1Ba fKs7aNGPwKJn0rw1qdHIeNbxyOZEmKi9uTbVcn32odAzae6rOZyfNRXBsk36jwiwNwqX z6Z88sUJ3Sr2JRWk4wxrmp9mP8VG0zlDTxIaXvKfgLGs1Sq9DebHOuZbRRMcGkorJvoW 6iJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=19YQ8StdkncwPnXni/oVwNkX1K4n6ibv08SiiaiztbI=; b=Fd8LEM3gCesiI0CbzoRZGudqJhsXg46HZH/La1EsJm3R5z1kbEx1n8bQOu0OpLfrP4 ndo3wags3givq6z0tsCxRxbubvrV+QlJhhCdP+4vvTAXQwTzDy7rcpRD48p94saBpjho nBCntlZ8VV/UYSeDQYj5wDsEUidhzs1GJkmFs42lGPVAVdenbkE9E/Y30dizvalEQuNj AK6kK5HM6uwg/wiKNuVNlME3o0ISF4hOYxBRAgFXXJSOclxOA0oAUcUyf9ZcCsGWvg/E PfFcvVEwkHetB68EvowaGtLr2uQhPonGVlEmnTd/SvulWQAsGmewgocyvvDxb4vyKbGU 8MNg== X-Gm-Message-State: AElRT7Em9FU2cEpfAqQrI2Y+yIj2s6dIEpkeZyNmVXJi8mzIU4AAmUph XXKD8SxKOEmGmB1Am0m8xXs= X-Received: by 2002:a19:a9d3:: with SMTP id s202-v6mr308316lfe.30.1522176739159; Tue, 27 Mar 2018 11:52:19 -0700 (PDT) Received: from uranus.localdomain ([5.18.102.224]) by smtp.gmail.com with ESMTPSA id j4sm325925lja.10.2018.03.27.11.52.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Mar 2018 11:52:18 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id D9854460B19; Tue, 27 Mar 2018 21:52:17 +0300 (MSK) Date: Tue, 27 Mar 2018 21:52:17 +0300 From: Cyrill Gorcunov To: Yang Shi Cc: Michal Hocko , adobriyan@gmail.com, willy@infradead.org, mguzik@redhat.com, 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 Message-ID: <20180327185217.GK2236@uranus> References: <1522088439-105930-1-git-send-email-yang.shi@linux.alibaba.com> <20180327062939.GV5652@dhcp22.suse.cz> <95a107ac-5e5b-92d7-dbde-2e961d85de28@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95a107ac-5e5b-92d7-dbde-2e961d85de28@linux.alibaba.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 27, 2018 at 02:38:11PM -0400, Yang Shi wrote: > > Why do we need to hold mmap_sem here and call find_vma, when only > > PR_SET_MM_ENV_END: is consuming it? I guess we can replace it wit the > > new lock and take the mmap_sem only for PR_SET_MM_ENV_END. > > Actually, I didn't think of why. It looks prctl_set_mm() checks if vma does > exist when it tries to set stack_start, argv_* and env_*, btw not only > env_end. > > Cyrill may be able to give us some hint since C/R is the main user of this > API. First and most important it makes code smaller. This prctl call is really rarely used. Of course we can optimize it, but as I said I would prefer to simply deprecate this old interface (and I gonne to do so once time permit).