Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1814812yba; Fri, 17 May 2019 05:59:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOJoZ2IJoXV/8afPlfXfcYTFsW4KRKcu9Xyr5t/Cl8FkIRz01lVOoWT1HPm9gjnO/rWT+M X-Received: by 2002:a17:902:f085:: with SMTP id go5mr48737923plb.53.1558097952245; Fri, 17 May 2019 05:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558097952; cv=none; d=google.com; s=arc-20160816; b=bjxzGbl2ysoi82sFYkxMOIL5V7t5plR/DsOfO2bEkI6KsJjytLci/K7NDJFcZdwI6C yjnuAZPJw6bMyrDMR7dADP9XUbXYr2ZQjbXFPZxUWrULF7v0X9XsKMLTSOeNWbh+icXJ cbrZjA/H1ihnd7MxjjpHTvEZsQGUnqqX/dAKlFtFEx0uYLJ7rxm28KaqrF1pGqzftZof DfjEpR77GyLXCvHDMYcv8368iV4TCBrdIMHcNdxiNMyoVCW30GeTolw6fOPCztBXBO/X T3hELhG+pCM0h5v0bPSmiyq5QiXSeEwRtYRUF+HU1tEQIjRvTcfnLX8VNQjM5Ck7AiA/ s9iA== 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; bh=w3orLxAiVlLhkI1QU8ebwF1UsyzvRSt1yqaaxnHspJY=; b=ef1BxgUznbCN1lz/v83uUAS9+xilctHnwhYpuQSlDg3HW4Ib85X/y5VpDVOIImKhbr 7YsPna+Xa1v2zBF6GQCTSIbKBvFE0kpNFLewmT0MgHAwQDMqRISqqIrOcQEityMqO0fW ZN9oRyxFWoqSwWuzDE22l9gjbQsVPaHqGWDk1qFM/mq6SfkBaR3B8++glxpnSeuWlQqa rr8scD3tWuNQUHV9xZE5bmrBhD2ZwTxsOrCeeSNZy0fi4hGFdMWSNczbnYZEOoIzOiz/ 6N29/KtN+qLp3by6oPbVTU/ejwRaeftxQmvXpEoOndH3Gdp0L47s3cMhX7QcnYwwQhgG p5lQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si7857970pge.593.2019.05.17.05.58.56; Fri, 17 May 2019 05:59:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728409AbfEQMp5 (ORCPT + 99 others); Fri, 17 May 2019 08:45:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:34538 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728207AbfEQMp5 (ORCPT ); Fri, 17 May 2019 08:45:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 48ECDAF59; Fri, 17 May 2019 12:45:56 +0000 (UTC) Date: Fri, 17 May 2019 14:45:55 +0200 From: Michal Hocko To: Konstantin Khlebnikov Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Cyrill Gorcunov , Kirill Tkhai , Al Viro Subject: Re: [PATCH 2/5] proc: use down_read_killable for /proc/pid/smaps_rollup Message-ID: <20190517124555.GB1825@dhcp22.suse.cz> References: <155790967258.1319.11531787078240675602.stgit@buzz> <155790967469.1319.14744588086607025680.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155790967469.1319.14744588086607025680.stgit@buzz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 15-05-19 11:41:14, Konstantin Khlebnikov wrote: > Ditto. Proper changelog or simply squash those patches into a single patch if you do not feel like copy&paste is fun > > Signed-off-by: Konstantin Khlebnikov > --- > fs/proc/task_mmu.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index 2bf210229daf..781879a91e3b 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -832,7 +832,10 @@ static int show_smaps_rollup(struct seq_file *m, void *v) > > memset(&mss, 0, sizeof(mss)); > > - down_read(&mm->mmap_sem); > + ret = down_read_killable(&mm->mmap_sem); > + if (ret) > + goto out_put_mm; Why not ret = -EINTR. The seq_file code seems to be handling all errors AFAICS. > + > hold_task_mempolicy(priv); > > for (vma = priv->mm->mmap; vma; vma = vma->vm_next) { > @@ -849,8 +852,9 @@ static int show_smaps_rollup(struct seq_file *m, void *v) > > release_task_mempolicy(priv); > up_read(&mm->mmap_sem); > - mmput(mm); > > +out_put_mm: > + mmput(mm); > out_put_task: > put_task_struct(priv->task); > priv->task = NULL; -- Michal Hocko SUSE Labs