Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2683657ybt; Mon, 22 Jun 2020 04:39:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5oX6IciL9IzV/tVdNDp9ylmvf1Yq7nd5cXwr7uRtHVR6BQe2OBaUiP4bqdlqeWB+i6ieq X-Received: by 2002:a17:906:66d0:: with SMTP id k16mr15770154ejp.293.1592825945624; Mon, 22 Jun 2020 04:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592825945; cv=none; d=google.com; s=arc-20160816; b=Y6iu+1WC4+3FzkMKgKaTssZQWcSxMNjWW6IJOYDBGB72zHDz+B6YOhWYtT/Z/k5GAt wt+qcJ1QtLFiSDZgBdk8yOGymiZ4VQApgvcqY8qzHF0rCXHw908j4rdihxY39thj/xlT /OzLOwtOEZJaNjbNxEwpvKBEjt0ZtBlepRCHv+0fkfRb00MF1QIS7qEwLM8lRiPss7Et 4ivGY7r6q9W+KhKhnsZQQpKncOAFXY9VUpUlQlc49mp0QZA/cv66/Gb7hhLq1NbfTEFq D/QxiiYXQlRVDaKajuw3o6xtGCGFV5qhf+LvkzQEVUqFGSdJD8B6ucWfEcitoL8R8X6a vf7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=MhWqm0Jh6kXGwBKlhQMQQx7BIn7w3L4AXtenzrcCx7A=; b=lzRmzzYAHvyK/A6Eg4umG4VySCCVf8kTBxulxKEqpquto43scbj9Fif8OvYvVRCyPp Ne4QSTjktsR14JRpA9MMNusqMSS58Kq95BO9BWkuvhhrSmKiGnkWc2vkVkqPGBv+FLmt Onui35Uxx0dAIjHlxrkoxXLxngWba7STOP+oGoRblb2pC46rN7jNAPFnUspvZIDjQiOT +iGxS9L5XCSSmDY2RNGcbyAmAFpjRv/N9YzoEt8Afmm0RKNecX6GtIFnDc53whXdd5ho 7ZF5OfQyZnoHnY+yNGJe/IMYxqs8/df8uAxn+A4/NgF/wSKBYVxp7iqYPetg/kqgSHGq j/Zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si8934744edz.575.2020.06.22.04.38.43; Mon, 22 Jun 2020 04:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbgFVLgP (ORCPT + 99 others); Mon, 22 Jun 2020 07:36:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35329 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgFVLgP (ORCPT ); Mon, 22 Jun 2020 07:36:15 -0400 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jnKkF-0000YV-Mk; Mon, 22 Jun 2020 11:36:11 +0000 Date: Mon, 22 Jun 2020 13:36:10 +0200 From: Christian Brauner To: Dominique Martinet Cc: Oleg Nesterov , Alexander Kapshuk , linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, liuzhiqiang26@huawei.com, joel@joelfernandes.org, paulmck@linux.vnet.ibm.com, kernel test robot Subject: Re: [PATCH] kernel/signal.c: Export symbol __lock_task_sighand Message-ID: <20200622113610.okzntx7jmnk6n7au@wittgenstein> References: <20200621133704.77896-1-alexander.kapshuk@gmail.com> <20200622062527.GA6516@redhat.com> <20200622083905.c3nurmkbo5yhd6lj@wittgenstein> <20200622102401.GA12377@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200622102401.GA12377@nautica> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 12:24:01PM +0200, Dominique Martinet wrote: > Christian Brauner wrote on Mon, Jun 22, 2020: > > On Mon, Jun 22, 2020 at 08:25:28AM +0200, Oleg Nesterov wrote: > >> current->sighand is stable and can't go away. Unless "current" is exiting and > >> has already passed exit_notify(). So I don't think net/9p needs this helper. > > > > From what I can gather from the thread (cf. [1]) that is linked in the > > commit message the main motivation for all of this is sparse not being > > happy and not some bug. (Maybe I'm not seeing something though.) > > > > The patch itself linked here doesn't seem to buy anything. I agree with > > Oleg. Afaict, lock_task_sighand() would only be needed here if the task > > wouldn't be current. So maybe it should just be dropped from the series. > > Sure. I honestly have no idea on what guarantees we have from the task > being current here as opposed to any other task -- I guess that another > thread calling exit for exemple would have to wait? When a thread in a non-trivial thread-group (sorry for the math reference :)) execs it'll unshare its struct sighand. The new struct sighand will be assigned using rcu_assign_pointer() so afaik (Paul or Oleg can yell at me if I'm talking nonsense) any prior callers will see the prior sighand value. > What about the possibility of sighand being null that the function does > check, is that impossible for current as well? See above, I think that's impossible. > > > Honestly not a part of the code I'm much familiar with, this all > predates my involvement with 9p by a fair bit... We can't be experts in everything. :) Christian