Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1441707pxf; Fri, 26 Mar 2021 07:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyErf5OdeX0CD6E0oa8MEq8VVcSmi6sjI3JWHQh3t5kF9Dj7zAgzXLyM//XsPT782bcxc/p X-Received: by 2002:aa7:d416:: with SMTP id z22mr15363641edq.239.1616770499550; Fri, 26 Mar 2021 07:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616770499; cv=none; d=google.com; s=arc-20160816; b=ExAvJkG3V1+PIe/ZZkt2gZIxy1MT5F3PSFerGL/KdthhOG/Azg5/6TQUZMuDvXHtTT KXDvI/M3yNach09M1b7w7lM9f110RYz7s+CSE4qPpJvfkfUb2GYJmBuaGtqcJ3uW6cIa oGzKtoIulEvRAryr1Sd12G12xtxzro3SQcjGDqLU+5b+NyG/FFQN75ou4KW0q5zz23xk bTIIeps/0UqusnUtKBO4vXTI2ccri0De5jN7mAHNDQ/k4I6ehynmBh3Pq04XhXAwBVG/ /0Eot/FYrQEVd0ppOXR5/TJb5mBl95UyLjQAwKt5RDuyXm6ULWmn7mr991UxKLNjjJVb ifFA== 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=NXuRAzdKEe7N5IQQl9xMaaIUvBWdEBQEbrAPEIQ9aXQ=; b=GPfuYFyiVxykpT96w4HHCwNEecBDrZolJcxoL1WbdpHaO7dSSFZQe76Mow529FuwHB 8NKST448pprT2/bOPqCJ7XtzY4+t6DC1xBZg4JLNs6BEvzwO+LnmWwiZW1L0TBaai4lF OMk4gZn/OaUuqwRyJAgMpWcUQd4SqZQLUuI90vbr/Id/k6RgPjzew3+tIGhqZhaz0XJ4 SYeESo0/TnyeOo2tD1x9iSdzWlnRRoQ9R2aftzHaqFg9TDJRfDQNFrOYiFdmQuUSJ2bS CKuF2D5KAbT4BJHL5h7XUB5ykU2YIpQcTB2FyqzxN4T4UXbZ9i8NDDHZpTHdCzSflRVj IOpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=L1c239be; 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 ks7si6909478ejb.682.2021.03.26.07.54.37; Fri, 26 Mar 2021 07:54:59 -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=L1c239be; 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 S230016AbhCZOxi (ORCPT + 99 others); Fri, 26 Mar 2021 10:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbhCZOxJ (ORCPT ); Fri, 26 Mar 2021 10:53:09 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E989CC0613B1 for ; Fri, 26 Mar 2021 07:53:08 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id z136so5626214iof.10 for ; Fri, 26 Mar 2021 07:53:08 -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=NXuRAzdKEe7N5IQQl9xMaaIUvBWdEBQEbrAPEIQ9aXQ=; b=L1c239beA0XBmspjlf3y3HTn9Z9nSwHses5P2ve269y9Unj7cktKPCwBrhu49QIUl5 Av2iihOObkQ6ymlCFAaKtP03ouqEoNUoXf2erXD6Gtk9xvhyXuNZPmLY+qUSIs3fxyyu lV6CdQmVAX74ip4lNGNqKf+tgzhu2XAstjvYIL37jlTQAKHqi3VhxeWVQYbTaFdcgrGq jOipfo5X6XpEA/FvCHObZ1DYHbACLIRfWRYgSzVOI1Ke0vHIu0QQKAen8sdiX2oqkkwi /KPaHiffO323G8N79uYVv8MjciAsxrcCOs1ELgEphitmKlMeRzYFJSpvtH4TrD6kUGMH FDiw== 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=NXuRAzdKEe7N5IQQl9xMaaIUvBWdEBQEbrAPEIQ9aXQ=; b=BjY9r7L+f1t41s3g9GpNI4lrCsVj1uCFZBtkUm0CQnSAo2KR1dLXOI8dCjPt+v0S1h m52+7ve1WmA8vCRAJ/QhrP39EbLomNieAcoGoLsaOCQfueMyoAHWnFXl2Rady36dbTeW ev6ih3y4f5FvpGkH2G42bzF8+gXeAgcjLtvcECmJqsWoSGhOHLxWbZ2W+T3Yff1fabJm j+D45bpUxnFTF9wLBtVanHKqPnMe6c7iPkvn/spJYXI5udrJqKDQRY+wUt2yI2I4lzvy 9VdntqM3FzBYa0vGH0Ja95NjOZLZ1fk6zD+fBUzhTA0rG0/+WEk5pEEcR0OFhEV4eiQY gOXA== X-Gm-Message-State: AOAM533MAKtKHBEhP50ciZquk8xmnGzt8C16D5R+3L4UqbY4fLpRUMKa 5XX3+GzsEqLUEFbJJnEFMRQAsRd+zKN1sA== X-Received: by 2002:a02:cc1a:: with SMTP id n26mr12397597jap.21.1616770388203; Fri, 26 Mar 2021 07:53:08 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id v17sm4394179ios.46.2021.03.26.07.53.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Mar 2021 07:53:07 -0700 (PDT) Subject: Re: [PATCH 0/6] Allow signals for IO threads To: Stefan Metzmacher , io-uring@vger.kernel.org Cc: torvalds@linux-foundation.org, ebiederm@xmission.com, oleg@redhat.com, linux-kernel@vger.kernel.org References: <20210326003928.978750-1-axboe@kernel.dk> <8efd9977-003b-be65-8ae2-4b04d8dd1224@samba.org> <0c91d9e7-82cd-bec2-19ae-cc592ec757c6@kernel.dk> <66fa3cfc-4161-76fe-272e-160097f32a53@kernel.dk> <67a83ad5-1a94-39e5-34c7-6b2192eb7edb@samba.org> From: Jens Axboe Message-ID: <0396df33-7f91-90c8-6c0d-8a3afd3fff3c@kernel.dk> Date: Fri, 26 Mar 2021 08:53:07 -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 8:45 AM, Stefan Metzmacher wrote: > Am 26.03.21 um 15:43 schrieb Stefan Metzmacher: >> Am 26.03.21 um 15:38 schrieb Jens Axboe: >>> On 3/26/21 7:59 AM, Jens Axboe wrote: >>>> On 3/26/21 7:54 AM, Jens Axboe wrote: >>>>>> The KILL after STOP deadlock still exists. >>>>> >>>>> In which tree? Sounds like you're still on the old one with that >>>>> incremental you sent, which wasn't complete. >>>>> >>>>>> Does io_wq_manager() exits without cleaning up on SIGKILL? >>>>> >>>>> No, it should kill up in all cases. I'll try your stop + kill, I just >>>>> tested both of them separately and didn't observe anything. I also ran >>>>> your io_uring-cp example (and found a bug in the example, fixed and >>>>> pushed), fwiw. >>>> >>>> I can reproduce this one! I'll take a closer look. >>> >>> OK, that one is actually pretty straight forward - we rely on cleaning >>> up on exit, but for fatal cases, get_signal() will call do_exit() for us >>> and never return. So we might need a special case in there to deal with >>> that, or some other way of ensuring that fatal signal gets processed >>> correctly for IO threads. >> >> And if (fatal_signal_pending(current)) doesn't prevent get_signal() from being called? > > Ah, we're still in the first get_signal() from SIGSTOP, correct? Yes exactly, we're waiting in there being stopped. So we either need to check to something ala: relock: + if (current->flags & PF_IO_WORKER && fatal_signal_pending(current)) + return false; to catch it upfront and from the relock case, or add: fatal: + if (current->flags & PF_IO_WORKER) + return false; to catch it in the fatal section. -- Jens Axboe