From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29C79C3A5A7 for ; Wed, 4 Sep 2019 14:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 089B02077B for ; Wed, 4 Sep 2019 14:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730981AbfIDOgj (ORCPT ); Wed, 4 Sep 2019 10:36:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41640 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDOgi (ORCPT ); Wed, 4 Sep 2019 10:36:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 575D4A28738; Wed, 4 Sep 2019 14:36:38 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.63]) by smtp.corp.redhat.com (Postfix) with SMTP id 94B9060BFB; Wed, 4 Sep 2019 14:36:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 4 Sep 2019 16:36:36 +0200 (CEST) Date: Wed, 4 Sep 2019 16:36:33 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Linus Torvalds , Russell King - ARM Linux admin , Peter Zijlstra , Chris Metcalf , Christoph Lameter , Kirill Tkhai , Mike Galbraith , Thomas Gleixner , Ingo Molnar , Linux List Kernel Mailing , Davidlohr Bueso Subject: Re: [PATCH 1/3] task: Add a count of task rcu users Message-ID: <20190904143632.GE24568@redhat.com> References: <20190830160957.GC2634@redhat.com> <87o906wimo.fsf@x220.int.ebiederm.org> <20190902134003.GA14770@redhat.com> <87tv9uiq9r.fsf@x220.int.ebiederm.org> <87k1aqt23r.fsf_-_@x220.int.ebiederm.org> <87ef0yt221.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ef0yt221.fsf_-_@x220.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 04 Sep 2019 14:36:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02, Eric W. Biederman wrote: > > @@ -900,10 +900,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) > - /* > - * One for us, one for whoever does the "release_task()" (usually > - * parent) > - */ > + /* One for the user space visible state that goes away when reaped. */ > + refcount_set(&tsk->rcu_users, 1); forgot to mention... This is minor, but we don't really need to initialize child->rcu_users in dup_task_struct(), we can just add .rcu_users = REFCOUNT_INIT(2), into init_task's initializer. Until we have a refcount_inc(task->rcu_users) user, of course. Oleg.