Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6451219imu; Mon, 21 Jan 2019 09:06:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN66pX2YpdlA6PeMTB87/Sw01d+LNg2KaSAm7VRCUvmLGWB2pYKXH1lK54uu5+x8ilkWobJd X-Received: by 2002:a62:3888:: with SMTP id f130mr29905114pfa.132.1548090413618; Mon, 21 Jan 2019 09:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548090413; cv=none; d=google.com; s=arc-20160816; b=q32RojbHQMVYfxBvR4fKL1dNoe77AqNXw5T0JEW/MQfYGBG51T/pPVNZcAhg2R9Dck yPV2MfzQ6ORD3zKXwVHf2Fs0X05LRDNK7t5a3nXdezLRCK/lAJ/p3RzhI7/JGiWDdFV+ 9gPA+4STD1b2nQN9Dh+ElhdieR9JP+0Mm8gZd6B2IlzdgCjYl2F2Er8tNMR8Qg0+O96G zjZ4YAPAajYczbCHvf2cGpsIOgwXUhumOPkjTvtjODf6QN+DKec2aaLwu71F5L/qzE71 K2QVOo8BhghTiDsQaOtOR98YVY0m4cA5QBzgBJU5Pl/VU/jkNCPRFA4UQ6do+f5vEvSr DKOQ== 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=Mrf42PWj2HF9K329m4nAGMk5JPBXieUebS85DqP5+Ho=; b=qeG69l2cnXzDWKTsvv54IZwnIIcv9+Wnmqxd8mxcSlef65z4Z9j2OCZzEL5JkO5YNc +/hGgsDP1YsEEsSx2qzR91TmKUEvW/MsRJKFO8toFhtHbi45NvikhJnDkGiV8BUepZGG 8DosWCnSzak3JWNbtuU8BnLAsf8vlegtOgAraLQXeCiCqUNHBn5YieM+qxA31tG2odri rq+NG13c/eP9wOSYdRpqR5Mtc2kXBeZk0MZoIoTK1BQdiwjgJwzRLQBn8T10Ik4dX7F0 WSphMxAe+5Fs690kQhLSw7ET/9o5iGFa+xTjkFXX1kiH0k9kR7GnD7xv4uIHHYCmOqgD Dgag== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si12897645pfq.129.2019.01.21.09.06.28; Mon, 21 Jan 2019 09:06:53 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfAURFQ (ORCPT + 99 others); Mon, 21 Jan 2019 12:05:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfAURFP (ORCPT ); Mon, 21 Jan 2019 12:05:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DE603D962; Mon, 21 Jan 2019 17:05:15 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.18]) by smtp.corp.redhat.com (Postfix) with SMTP id 3CE4360A9F; Mon, 21 Jan 2019 17:05:13 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 21 Jan 2019 18:05:14 +0100 (CET) Date: Mon, 21 Jan 2019 18:05:12 +0100 From: Oleg Nesterov To: Elena Reshetova Cc: mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, keescook@chromium.org, tglx@linutronix.de Subject: Re: [PATCH 1/5] sched: convert sighand_struct.count to refcount_t Message-ID: <20190121170511.GA8088@redhat.com> References: <1547814450-18902-1-git-send-email-elena.reshetova@intel.com> <1547814450-18902-2-git-send-email-elena.reshetova@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547814450-18902-2-git-send-email-elena.reshetova@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 21 Jan 2019 17:05:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18, Elena Reshetova wrote: > > --- a/fs/proc/task_nommu.c > +++ b/fs/proc/task_nommu.c > @@ -64,7 +64,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) > else > bytes += kobjsize(current->files); > > - if (current->sighand && atomic_read(¤t->sighand->count) > 1) > + if (current->sighand && refcount_read(¤t->sighand->count) > 1) > sbytes += kobjsize(current->sighand); > else > bytes += kobjsize(current->sighand); I fail to understand this code with or without the patch... I do not see how is it possible to hit ->sighand == NULL or sighand->count == 0 in proc_pid_status() paths. Nevermind, this is off-topic. Reviewed-by: Oleg Nesterov