Received: by 10.213.65.68 with SMTP id h4csp384307imn; Tue, 27 Mar 2018 00:39:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELvAFkMNXgo9jbRugTzW6KiYidN1l4GFVlyfRws9tbTazH2/98XBNf2p6KdlGvIk+D2gXkk1 X-Received: by 10.98.166.14 with SMTP id t14mr30313152pfe.195.1522136396366; Tue, 27 Mar 2018 00:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522136396; cv=none; d=google.com; s=arc-20160816; b=dbBgjP6dZZP2ZvNNj9stjQn9Sw1J3Gbrl+1tMKcGwrLyAyjfNhK9Nm6+8Godj7+vfm Qn59slIGsgGsUqglKV4D5mW/6a2kNLhGBT4AJb3vUWHe7oLYjx8kDmL/pC+wnQuBgSIC 8Ua1fImQS8EkLx4tcdoFiZSvfkJ03OX7wFtbZwLv3hQ65cdk8KPNoTRfyrZ3xmL9mEhW sanFQXLelFYbrO8bZtdvjB0i/Ol3vZyvKoYuc4qOixj/S5qiIeD9MOc0X/4NE3ZSeGGE FLm3GAFsc6K8SGC+0j9RL87TwArQizCHhOZK8nTMpCEOEimejlra+Gt/j5ZLi8amkTYf 8rIA== 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=mLfJPwQtiUXJDNkCR4MQPZjzGNK+uP8KE1YmX9mE5us=; b=bLD3HvMWLgriQaQ74YpWhy3SIfXPvyuErdj+HwWpIwwXIgncByPC6qH64dEYYGnw0T 0gQGi2IrC9QNfmU6E6EExmmmBRUfIewOT3UMQ+/TZmi5L0vQk63FSUXEeDoxkFy556UT /ALkrQJxCd38nEF64Yh1DkopOUqrVp3KeRs+bq6rikRqpOaRTQCsz64l6GZXdHzLO4VW k3pHveAkFhKz3AVK2omkg5ColhKrTQPfle2FtndKt9l7sDYZLPa5RHdgbMT1rDlVD9bG G774zImUM07szC4Hv8HqIKCj2FsCCzbdSq2elaYhotbSoCyP0w4EwC8IrEET+2X9qC+l s94w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fgwmo+S4; 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 b24-v6si644603pls.222.2018.03.27.00.39.41; Tue, 27 Mar 2018 00:39:56 -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=fgwmo+S4; 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 S1751048AbeC0Hii (ORCPT + 99 others); Tue, 27 Mar 2018 03:38:38 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:39052 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbeC0Hih (ORCPT ); Tue, 27 Mar 2018 03:38:37 -0400 Received: by mail-lf0-f66.google.com with SMTP id p142-v6so31845373lfd.6 for ; Tue, 27 Mar 2018 00:38:36 -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=mLfJPwQtiUXJDNkCR4MQPZjzGNK+uP8KE1YmX9mE5us=; b=fgwmo+S4/bgkOyrGfdyZMaPfXw8YCVChaM1Czr7pfH+8R7d+BVm4S0PHYgIAnKL9x/ lPnPlhCxeU3gVNH6u0R82+7cC940Ke94NuetkMHlmT/4GArcSOUhdEGtmwvPopM2o/yl xnkInz3wFAFvKqf6Xi0rK8hgve3C5mytVgO4AqGSZyOs2qiSC57lc+7iPO2txIoGT48W snMlpyLD+gQXatBLmzIxUUIT35hPlAOBMUy3hF8ozNd/RWcWwzRsYpiYB4fq9WvUTAng 8yNYQD9SH+8lAsQhkeNd7U6BGvx6kZcsnQUBncp6hWAIjf0WDbhRI8h13jsVfiYranAH 1WdQ== 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=mLfJPwQtiUXJDNkCR4MQPZjzGNK+uP8KE1YmX9mE5us=; b=pIoIex9hEdou5pHz4IvQZnCa9jKqnN+Q+azicq8nbWr1aBSPEFB22dOrmSfG47VBEp zMXUG/rnU+cIpFu7L7S/2nvYWAKmNRXn8jiXAKGkJ5Wn4Gl9eXXu6eutlzTF9ZRbeHLk oAGE5Etl9/2eNqnVAiZ2UBcZJLoSeI/0UqjizSgTQg0+7c4vDnPrE6ohoXVE09HhZxtq hyBj/922onGHm/GJ1s2YdBRBCy2D0BkVlIBG//mPHsDMvJwYlAa/cmN6/KKx5XtGm/nS WSbb40k3eMamYpr2KlMgt5XkKFlxuvhTtFjuZ1hw8edlBAt8mecgJNtzzIUA6aB3KHB6 nk7A== X-Gm-Message-State: AElRT7HK0g92IoDwTJaeWwO2zoHUrfYSLqq0X5QBRDMZdZa1ZGpa2Csu StQR4NvBOASULJwOHd86frw= X-Received: by 2002:a19:4350:: with SMTP id m16-v6mr25798152lfj.73.1522136316112; Tue, 27 Mar 2018 00:38:36 -0700 (PDT) Received: from uranus.localdomain ([5.18.102.224]) by smtp.gmail.com with ESMTPSA id w17-v6sm115968lff.76.2018.03.27.00.38.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Mar 2018 00:38:35 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id F3994460AA4; Tue, 27 Mar 2018 10:38:34 +0300 (MSK) Date: Tue, 27 Mar 2018 10:38:34 +0300 From: Cyrill Gorcunov To: Yang Shi Cc: Tetsuo Handa , willy@infradead.org, adobriyan@gmail.com, mhocko@kernel.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: <20180327073834.GI2236@uranus> References: <1522088439-105930-1-git-send-email-yang.shi@linux.alibaba.com> <20180326183725.GB27373@bombadil.infradead.org> <20180326192132.GE2236@uranus> <0bfa8943-a2fe-b0ab-99a2-347094a2bcec@i-love.sakura.ne.jp> <20180326212944.GF2236@uranus> <201803270700.IJB35465.HJQFSFMVLFOtOO@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Mar 26, 2018 at 06:12:55PM -0400, Yang Shi wrote: > > + if (unlikely(arg_start > arg_end || env_start > env_end)) { > > + cond_resched(); > > + goto retry; > > Can't it trap into dead loop if the condition is always false? Yes, unfortunately it can. > > + } > > > > for reading these fields. > > > > By the way, /proc/pid/ readers are serving as a canary who tells something > > mm_mmap related problem is happening. On the other hand, it is sad that > > such canary cannot be terminated by signal due to use of unkillable waits. > > I wish we can use killable waits. > > I already proposed patches (https://lkml.org/lkml/2018/2/26/1197) to do this > a few weeks ago. In the review, akpm suggested mitigate the mmap_sem > contention instead of using killable version workaround. Then the > preliminary unmaping by section patches > (https://lkml.org/lkml/2018/3/20/786) were proposed. In the discussion, we > decided to eliminate the mmap_sem abuse, this is where the patch came from.