Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3536743ybi; Mon, 10 Jun 2019 11:58:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5Eu1RZoSAiT1PDp5rsnrkb9TG5qWyCYUmFeCHb9tGAoJgFhRt6z9mZd5Sx9kSRit1yHyJ X-Received: by 2002:a63:d504:: with SMTP id c4mr16633320pgg.20.1560193132885; Mon, 10 Jun 2019 11:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560193132; cv=none; d=google.com; s=arc-20160816; b=F16guLaDtckYuQdvmx8CfTQsMK9eIprJQG+Im1NGM02L6mRNPlC3nvCc2Ln/lUtL6+ y384EtojhZA8HnMroo9ee4fOkooQkuFO3aIU8Gqd2ipvt2BL0T/24eun22RQKyyE83or eN6mOZP0R58BgpFrBQSh6fdJ3JsByGhUgWpJTo//iQbCfw37lhvP3xKe6sw7CTwomq62 Lu0Si2tAKXV3t4vckJTgDG90vnf+Z6NBDtIuKLHRRBIOlLay93fQ7QKiJ6PkWtCWG2l0 WN71JHo9OQ+hke7fAaOI+p3uTj3GxqKxEyeXyScW5BZpg+ScnOw76qRP/N6Qf7wPHoT9 BuRA== 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=RPZGbefbXyaa0DALfZtnqVpFSQmajkOXzntvnw+q3Os=; b=AqHRx8XmXsZffnTGAnN7DKgq2aC+ny3xx+jv0wq0HR9OIwIwdMEKRsH/lWkYsabKWt 3duPXadr9I38wkX4qF6Killbzho5VvBaIyL+IwkH46JmPMcdE1blIKuqFs3o0lY03Q0/ k4MzQJqipJy0snGH1XOgrIJjgtCb4YGeJw3OXaHZsIggMuoP8T/z6g3EM92t6qAWDTJ8 KblP7gRgOT9Mm1RKjUpF4Xob+hhECcszuwXiDtM+67cziVAaybw/+FWVmZ0e3MZ+OGLF 3AkFodnKZqWRdIiBBJG8iZo2InrnR8AbfQ/GTABwcLx3plWWyBBcDjxTisN92WgR5fbm Gf7A== 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 s5si10501596pgr.361.2019.06.10.11.58.37; Mon, 10 Jun 2019 11:58:52 -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 S2388998AbfFJS6H (ORCPT + 99 others); Mon, 10 Jun 2019 14:58:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:46922 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388069AbfFJS6G (ORCPT ); Mon, 10 Jun 2019 14:58:06 -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 7B8E2ABC7; Mon, 10 Jun 2019 18:58:05 +0000 (UTC) Date: Mon, 10 Jun 2019 20:58:04 +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: <20190610185804.GB2388@dhcp22.suse.cz> References: <155790967258.1319.11531787078240675602.stgit@buzz> <155790967469.1319.14744588086607025680.stgit@buzz> <20190517124555.GB1825@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sun 09-06-19 12:07:36, Konstantin Khlebnikov wrote: [...] > > > 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. > > > > I've missed your comment. Sorry. > > down_read_killable returns 0 for success and exactly -EINTR for failure. You are right of course. I must have misread the code at the time. Sorry about that. -- Michal Hocko SUSE Labs