Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2638035ybt; Mon, 22 Jun 2020 03:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZmpnSf5R4WpeIplMQ4oeJb4CQQF5+XgfPm0LWtGWl4jgm/DPNl8kmxyuAqa94UeQFPu/2 X-Received: by 2002:a17:907:72cf:: with SMTP id du15mr14630376ejc.151.1592821606193; Mon, 22 Jun 2020 03:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592821606; cv=none; d=google.com; s=arc-20160816; b=NPOdJxIRu/lavwAbwmX9SfxFMujmm6fE75b3/EY1VHMo07+GRsdEYuEU5psH4RH2Eo kyOALNmcU/b+aK7SgnAObzw39IeKBAgecnxB+VRt6hww03Sdw0G+q2vlbWMUgYP8bg4F JWhIv/HgVSdWwsYS1a6KKGb3Z4mXhCIE1khF0TlzufegUPZv9sA+oAa3QhPGfDDFqGe4 2DiWAGQ8MijzxP56NN6zPGRyH+TgLzN0EQARyZ/JEnWjr0LqqOidlNu6fATFfu0oGM9n adHqoe+MCn5lD+DUx0z5U+9VTw2cAVxg7a8DxX0p1khNnV99k+jeYKDgOvNabUS/odeF p0Qg== 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=r0GMJSP6KSYO9LcsigYCQYhkXBLQ21D9BWv1JZzj/Go=; b=AnQ3l4p7cYTI0/NoKJ7fYC8dKEiXrDcXSUfiRg7d7GJ1u53//nZrbYFYF0rPdBQsSw +cfq9h+Z7L4wq5hvRKkS/1/KFr7CReSws3BM+6SZZQwqDJBNvkl2fAUrHzajNyXbPaD+ 0Ete/uslFaIuQsScb6kEVzliY2Yxdj1pWRVki98rL5SEDsANtsyAKR6TiMWSyv8MU8Ai xWafKrosbsk9riZyD2xkd+xmL8cMWBW2W1InTwM+yrYo1SG3Z84a/jSrLm+x+6gl1UD2 f4+uEQjwCAfRdfrSfTlh6WG+xuXseWzK/fA9buEgM1FkUWpzBTVB9qk2+rRkbxPPNeI3 Y/Ww== 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 v20si2263338edq.487.2020.06.22.03.26.23; Mon, 22 Jun 2020 03:26:46 -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 S1727097AbgFVKYV (ORCPT + 99 others); Mon, 22 Jun 2020 06:24:21 -0400 Received: from nautica.notk.org ([91.121.71.147]:48747 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbgFVKYT (ORCPT ); Mon, 22 Jun 2020 06:24:19 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id DBA46C01A; Mon, 22 Jun 2020 12:24:16 +0200 (CEST) Date: Mon, 22 Jun 2020 12:24:01 +0200 From: Dominique Martinet To: Christian Brauner 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: <20200622102401.GA12377@nautica> References: <20200621133704.77896-1-alexander.kapshuk@gmail.com> <20200622062527.GA6516@redhat.com> <20200622083905.c3nurmkbo5yhd6lj@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200622083905.c3nurmkbo5yhd6lj@wittgenstein> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? What about the possibility of sighand being null that the function does check, is that impossible for current as well? Honestly not a part of the code I'm much familiar with, this all predates my involvement with 9p by a fair bit... Anyway, not particularily fussy on this, it just looked like "the right way" to lock a task signal handler among the few common patterns I could see; I think it would make sense to just convert all such locks to a single pattern for a maintenance pov but it's much more work than I'm willing to do. I'll just drop the patch :) >> However, the games with TIF_SIGPENDING doesn't look right in any >> case. I definitely agree with this, hence my comment about an old patchset that will remove these eventually, but while I did send the patches over a year ago I never took them up due to lack of proper testing. It's been something people regularily complained about that it makes the task unkillable in a weird way and many tools like syzbot don't like it (and potentially users who try ^C won't either) I guess I'll try to find some time to finish that instead... Will be more useful than trying to wrap my head around all of that :P Thanks! -- Dominique