Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1256144rwd; Thu, 18 May 2023 09:47:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43GY82wBKfuoYt+B/esRmf4ZhYjP3oGfFNnYTogqryJ91BAqMw7hFtE7KA8SrXv/ZNsoDV X-Received: by 2002:a17:902:ce85:b0:1ac:95c2:ed75 with SMTP id f5-20020a170902ce8500b001ac95c2ed75mr3983163plg.53.1684428448131; Thu, 18 May 2023 09:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684428448; cv=none; d=google.com; s=arc-20160816; b=dL+TQyvYamR+rGWhvD2h2BPqlKClTkp8LJ6M7ZMYqx2ewSEZBQjVMtu0HsCK/+BFPE p6oOCu5UOb+kDlWGUcRn4lNFQQRKGTGIqWNopPDgInwnN3dFXQBkpmW+LUOrxzo3goo6 tJI6wGskX/j2b1Yh1F+ZF/jqr3c7G8hJZdj70y5L1OwwDeRDk1YJa4HyfD4WSXI3cwK9 cvanHrt7G0SXp6+DoMHbPFerkKrBlnqXhNHY9zsL8KFwitBtWq9VkKDBsdy8jwp/v/SL 65Lm2IFYB/ly3DkCYo039Yb/Mkura8Vrysq5rHvweApCTmNjQcGqsYfvDTW/XJHVNpMi ziPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=N0VBaOKRYTVXJE7z+8gKbNWq3wyr8YL28adwGI5M+8Q=; b=pU1j5d30D4fnpV9XSPcuSEedwL4xAnzkQKWMSuBDMgvF3npbz8+wkGYyU8b26dvSvy 5oItBeP3EDG0OUlnkza/C+OjyaQWbZwSWwfAa1tOjoW5S6NIuE67HP5cv0B+GOip9XQA FyuWXwmWiFmFtofcDa6Mub0AHTYoLxgzTkSpb6ebqzQmqQMkizm/OniK9XB7mClA+kWs fT3zpZ2/cTFlrppkgwoesk+ZxeaPZTr2aJ7ghiS6LiaNzv6IVRhKpbshhMDXhohxGA91 kyvIJ7B/4z5Vs7tNy4OXZkeNJ61lsXMFV64mcPzqPD3kI8bcIVtjZ1ut6tQQPKMIXQjm FWBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DCORfyWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a170902d70500b001ae4a4961d0si1611813ply.274.2023.05.18.09.47.13; Thu, 18 May 2023 09:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DCORfyWO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjERQ1I (ORCPT + 99 others); Thu, 18 May 2023 12:27:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbjERQ07 (ORCPT ); Thu, 18 May 2023 12:26:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACF87B3 for ; Thu, 18 May 2023 09:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684427171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N0VBaOKRYTVXJE7z+8gKbNWq3wyr8YL28adwGI5M+8Q=; b=DCORfyWOWZTH4RUdQkYEotrbDaBDq7rmrung2Il2lcqgbVhprM9KfA50kpxNsE/MWdKpcr ua7nQYShRBddGbZvgbJVDqKupq3fSK2rPxgB5eFzrPnoslVenEU5VBehEF2WfO2RGgv/hu b0Z5QD1xUtHl2eZt+Ed1cJGdn/7nXOc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-499-xlcIGl63Ncy0qqjYJ0vFaw-1; Thu, 18 May 2023 12:26:07 -0400 X-MC-Unique: xlcIGl63Ncy0qqjYJ0vFaw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2E18C805F58; Thu, 18 May 2023 16:26:07 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.20]) by smtp.corp.redhat.com (Postfix) with SMTP id 4D4651121314; Thu, 18 May 2023 16:26:04 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 18 May 2023 18:25:52 +0200 (CEST) Date: Thu, 18 May 2023 18:25:49 +0200 From: Oleg Nesterov To: Mike Christie Cc: "Eric W. Biederman" , linux@leemhuis.info, nicolas.dichtel@6wind.com, axboe@kernel.dk, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, mst@redhat.com, sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com, brauner@kernel.org Subject: Re: [RFC PATCH 1/8] signal: Dequeue SIGKILL even if SIGNAL_GROUP_EXIT/group_exec_task is set Message-ID: <20230518162508.GB20779@redhat.com> References: <20230518000920.191583-1-michael.christie@oracle.com> <20230518000920.191583-2-michael.christie@oracle.com> <87ednei9is.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I too do not understand the 1st change in this patch ... On 05/18, Mike Christie wrote: > > In the other patches we do: > > if (get_signal(ksig)) > start_exit_cleanup_by_stopping_newIO() > flush running IO() > exit() > > But to do the flush running IO() part of this I need to wait for it so > that's why I wanted to be able to dequeue the SIGKILL and clear the > TIF_SIGPENDING bit. But get_signal() will do what you need, dequeue SIGKILL and clear SIGPENDING ? if ((signal->flags & SIGNAL_GROUP_EXIT) || signal->group_exec_task) { clear_siginfo(&ksig->info); ksig->info.si_signo = signr = SIGKILL; sigdelset(¤t->pending.signal, SIGKILL); this "dequeues" SIGKILL, trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO, &sighand->action[SIGKILL - 1]); recalc_sigpending(); this clears TIF_SIGPENDING. > Or I don't need this specifically. In patch 0/8 I said I knew you guys > would not like it :) If I just have a: > > if (fatal_signal()) > clear_fatal_signal() see above... Well... I think this code is actually wrong if if SIGSTOP is pending and the task is PF_IO_WORKER, but this is also true for io-threads so we can discuss this separately. Oleg.