Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1670051pxf; Fri, 26 Mar 2021 12:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5RE4hExdn5S0osYryalA8YdoNIN3in8OaDztZWCmBC2jYAKaeMXjLIZ1Dbl3HfbbdVx7k X-Received: by 2002:aa7:db4f:: with SMTP id n15mr16643234edt.12.1616785247986; Fri, 26 Mar 2021 12:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616785247; cv=none; d=google.com; s=arc-20160816; b=kK9e/13p0Rt7yKPR03zc302IgXTLwzTdSrAWwx1FnQ7eOB/FEQq8Q8ZQVEtVDvbcEg lxgXdGmfCTZLjExYINwqYxRyefAOK4kR8TEkjylL8GNV61L4chHgHtvgZwfUd2M1zD/R z24/S72GprJKbPM7QWr+07022/zv+X7jZX4psG71J7WT7JLXnEXOLjDnV4vdfh/5cwSJ QCRJTHzbxTSDap6OX7zni2nkJVNr+ShtqVwgF7vFf1kpubhtzxXvUmjXn/5WjIStq7RH SeJjhiAZw4R2tHiHJc+oYewZCxh5oVWJNWnWRXqpFZF0TJ8fTWv9He2mhAecYHBktp7s 7Obw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=IPTFHd/bFsFer84YcSkEwgKpuL9sF8ejRR5pI+umTEo=; b=ArBclNBsC5hxR17CoJoL5IKlUs6/s0Jg9x8HTt7wFjoyTTG3Gpkzil84jSZ8vTiFYx Fd51mPhz0HY+tczpBP4fw5t2qs/7djBZxTqA9AMKLa1fSZzkJBNOMB+C4WBny9Nf0dax v5+nTt3pkl1npY9FVLgZ14uVLcOfQHcrVctW+trF6NWU3RqbW8u0S3d91IkJvCf/VK7T FYC+JKvcuye6JMgbI4YQ8z2QlEowsQ4Z4Vk48zyUR0gkGnvPUlYGfdcuXxAjnz7cI1KG pLYbHbOJXBWAHkT9vXZGOKHNegkU+faCUIaFBufy2aq1M/1Rj05EvUKU07TccKK7T9vB p3yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b="yc/HSwMA"; 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 p10si7352304edw.62.2021.03.26.12.00.25; Fri, 26 Mar 2021 12:00:47 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b="yc/HSwMA"; 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 S230026AbhCZS73 (ORCPT + 99 others); Fri, 26 Mar 2021 14:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbhCZS7E (ORCPT ); Fri, 26 Mar 2021 14:59:04 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F385C0613AA for ; Fri, 26 Mar 2021 11:59:04 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id n21so6448996ioa.7 for ; Fri, 26 Mar 2021 11:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IPTFHd/bFsFer84YcSkEwgKpuL9sF8ejRR5pI+umTEo=; b=yc/HSwMASk6Ljayo+ULC4YvEGj3F6N23Ss3jM7K4MF5ctuibs1oJJmt4NQsEVWeSmO 2oeM9qhnb36ts+9IzfcFJjJKLf7OZu1xreMgc0bN6eNxUnX45gKpRsCyR7YG8B2e5MBv 7wd/RyLlkniwktDDXCtwBjVGaRr89Egh+t2v+MGHF9WtzkdxuMWI8xk4irhBYt0nt1qS lc1EPXq9Zg7x/aBrUl6/i3xf2d/6ALRR+EhFCxWdFUlBeosfNnCVnLJ+5nj5iKbxyaBo puQipbfQ0W+ZmGIyc+zDJDV8dhzwpURqnaAsjnvMjMtMi0C6SdBrrmLmFdsT3rQ2iBpR 7Amw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IPTFHd/bFsFer84YcSkEwgKpuL9sF8ejRR5pI+umTEo=; b=E1Nf2oDjEfQMBG4OdHNqsmYsnqAUkJ3ewGgeT5hiGDuyJdg7REGXL3vaN9H3dL03tT yMsmgZ4TmQN0upWELezHc5v7G8xY7Ndqn/QZtqlJ8e48P+eSSxIwaJ+fepfFOSocTYPz U8mhl+1kV3sIY4BfoTPZSnZiNClZ+BWgf5e2DowxhysxbRKLN0S4ozvjvel0t+RcHnev ub5bG0/KKi7wQ/iODMcXickJPeVf8ndrwSSfN6jdjR5bNXttvii3kUtJRFnGoPx1Oc31 eCuKEwHX2iH0joo32DqHGOzbe1T65Kjn+sW1zYs2OR9brxwPMVEHC45WQREFNm17zk/W O1tg== X-Gm-Message-State: AOAM532PpH2OzTrmfk3v6EpepX+p4w/8geI5LjIxJvSXzaYUw25TZsLN gt+zHwWau8khiOVStFqsjnLlG9LWraK3vw== X-Received: by 2002:a02:c002:: with SMTP id y2mr13308240jai.107.1616785142841; Fri, 26 Mar 2021 11:59:02 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id o23sm4771061ioo.24.2021.03.26.11.59.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Mar 2021 11:59:02 -0700 (PDT) Subject: Re: [PATCH 2/8] kernel: unmask SIGSTOP for IO threads To: Stefan Metzmacher , Oleg Nesterov Cc: io-uring@vger.kernel.org, torvalds@linux-foundation.org, ebiederm@xmission.com, linux-kernel@vger.kernel.org References: <20210326003928.978750-1-axboe@kernel.dk> <20210326003928.978750-3-axboe@kernel.dk> <20210326134840.GA1290@redhat.com> <8f2a4b48-77c9-393f-5194-100ed63c05fc@samba.org> <58f67a8b-166e-f19c-ccac-157153e4f17c@kernel.dk> From: Jens Axboe Message-ID: <857d1456-2258-f798-5927-ca4d82f10d50@kernel.dk> Date: Fri, 26 Mar 2021 12:59:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/26/21 12:01 PM, Stefan Metzmacher wrote: > Am 26.03.21 um 16:29 schrieb Jens Axboe: >> On 3/26/21 9:23 AM, Stefan Metzmacher wrote: >>> Am 26.03.21 um 16:01 schrieb Jens Axboe: >>>> On 3/26/21 7:48 AM, Oleg Nesterov wrote: >>>>> Jens, sorry, I got lost :/ >>>> >>>> Let's bring you back in :-) >>>> >>>>> On 03/25, Jens Axboe wrote: >>>>>> >>>>>> With IO threads accepting signals, including SIGSTOP, >>>>> >>>>> where can I find this change? Looks like I wasn't cc'ed... >>>> >>>> It's this very series. >>>> >>>>>> unmask the >>>>>> SIGSTOP signal from the default blocked mask. >>>>>> >>>>>> Signed-off-by: Jens Axboe >>>>>> --- >>>>>> kernel/fork.c | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/kernel/fork.c b/kernel/fork.c >>>>>> index d3171e8e88e5..d5a40552910f 100644 >>>>>> --- a/kernel/fork.c >>>>>> +++ b/kernel/fork.c >>>>>> @@ -2435,7 +2435,7 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) >>>>>> tsk = copy_process(NULL, 0, node, &args); >>>>>> if (!IS_ERR(tsk)) { >>>>>> sigfillset(&tsk->blocked); >>>>>> - sigdelsetmask(&tsk->blocked, sigmask(SIGKILL)); >>>>>> + sigdelsetmask(&tsk->blocked, sigmask(SIGKILL)|sigmask(SIGSTOP)); >>>>> >>>>> siginitsetinv(blocked, sigmask(SIGKILL)|sigmask(SIGSTOP)) but this is minor. >>>> >>>> Ah thanks. >>>> >>>>> To remind, either way this is racy and can't really help. >>>>> >>>>> And if "IO threads accepting signals" then I don't understand why. Sorry, >>>>> I must have missed something. >>>> >>>> I do think the above is a no-op at this point, and we can probably just >>>> kill it. Let me double check, hopefully we can just remove this blocked >>>> part. >>> >>> Is this really correct to drop in your "kernel: stop masking signals in create_io_thread()" >>> commit? >>> >>> I don't assume signals wanted by userspace should potentially handled in an io_thread... >>> e.g. things set with fcntl(fd, F_SETSIG,) used together with F_SETLEASE? >> >> I guess we do actually need it, if we're not fiddling with >> wants_signal() for them. To quell Oleg's concerns, we can just move it >> to post dup_task_struct(), that should eliminate any race concerns >> there. > > If that one is racy, don' we better also want this one? > https://lore.kernel.org/io-uring/438b738c1e4827a7fdfe43087da88bbe17eedc72.1616197787.git.metze@samba.org/T/#u > > And clear tsk->pf_io_worker ? Definitely prudent. I'll get round 2 queued up shortly. -- Jens Axboe