Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp52701pxf; Wed, 24 Mar 2021 20:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi+p3rDzA4r3mmbYWWUZ3wN5FB7I7WyIWpXjheaW2DM3eBrMoS5JvcfDHNsQFtsmdFU9kK X-Received: by 2002:a17:906:4e99:: with SMTP id v25mr7116179eju.532.1616643907026; Wed, 24 Mar 2021 20:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616643907; cv=none; d=google.com; s=arc-20160816; b=vxmrYBrCbHpgF0GCYRAKz8nRTgKE4gaCVZM/efNUA0iWgzEvzDXb6zps8lnSxNX21W TFPTEj7QHpWlBvnIsq9QS0JSKtjfEk/skGuhfe3rA66qUvMK61Fsz5SzPk/A8XEZ2eHA XFzzEjWl1+E5YsRgZnnB67DN8pmPDIGFLKQ7YvwbriNr3kW642Fo6SbjTOUP/CK4AoAo KRtHe2IFdjG2wZgqGP8pbCMo//1QZESRNAxSt6Pk4vN17nbIDgJVgO4DSgNu9acZOPlp MC152LlfNUGHgZSyWq3zijtbSw4acg6a0pNAWNFqkckhG+KoC+sK+mlY++on+5t05FZm xkWw== 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=O40ZXFmREbbNLPasEc4QZD9qoO27te5cNeANN7AvMJs=; b=mZjk6VIuXgUqdb7WW0PhKvj4xHQpPZWODGCOho1b0zVgZurs1vSxHPQNUTI/Lph5z2 RDscw2yclHe3DuMQbdSvM7kgD/t6wMfyYPA0P6D9DsSBzhvEtOf0naZviJognfF1V/g3 tlSrod5az41h8WtAbdvqWqjWIcoXvNe3ctlFurvalfcxUzrd38DUKf1YVaLyUAqREIlx DXT4XhGQMWAetUoT7YCr9MN6B1afqbQCqopLj3F7+q5q/VEsIdS4K/gqZuacLHMe86nv XGbQm6pA/BP8qWXUFCQxUEpJp+ffKITCILQCbRrasIJkooVxH+jRcbvmw/YGGjBCl4uB lG5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A+IyFcCG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ko14si3075701ejc.419.2021.03.24.20.44.45; Wed, 24 Mar 2021 20:45:07 -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=@redhat.com header.s=mimecast20190719 header.b=A+IyFcCG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235836AbhCYCwU (ORCPT + 99 others); Wed, 24 Mar 2021 22:52:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44241 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235358AbhCYCvy (ORCPT ); Wed, 24 Mar 2021 22:51:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616640714; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O40ZXFmREbbNLPasEc4QZD9qoO27te5cNeANN7AvMJs=; b=A+IyFcCGqNIqlH7qF/O7BEDllR+/fQ0M55rO5KVXz1HxLBvJA0VE1b3tvI6nxmXv4cl8w0 QOAzS+muWp/bdHEqe8v6m99P9WS6pAw5sK8Xi+HCKolIzWEOO74zn7NfhiqrgumidozCDt BXxsSy0MaQmiAWFpp4Wq6f4z40/8Hmc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-534-joTU2e24NFarjDDTNS2ftw-1; Wed, 24 Mar 2021 22:51:49 -0400 X-MC-Unique: joTU2e24NFarjDDTNS2ftw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EC9988127C; Thu, 25 Mar 2021 02:51:48 +0000 (UTC) Received: from [10.10.112.16] (ovpn-112-16.rdu2.redhat.com [10.10.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1731E5C257; Thu, 25 Mar 2021 02:51:47 +0000 (UTC) Subject: Re: [PATCH] livepatch: klp_send_signal should treat PF_IO_WORKER like PF_KTHREAD To: Dong Kai , jpoimboe@redhat.com, jikos@kernel.org, mbenes@suse.cz, pmladek@suse.com Cc: axboe@kernel.dk, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210325014836.40649-1-dongkai11@huawei.com> From: Joe Lawrence Message-ID: Date: Wed, 24 Mar 2021 22:51:46 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210325014836.40649-1-dongkai11@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/24/21 9:48 PM, Dong Kai wrote: > commit 15b2219facad ("kernel: freezer should treat PF_IO_WORKER like > PF_KTHREAD for freezing") is to fix the freezeing issue of IO threads nit: s/freezeing/freezing > by making the freezer not send them fake signals. > > Here live patching consistency model call klp_send_signals to wake up > all tasks by send fake signal to all non-kthread which only check the > PF_KTHREAD flag, so it still send signal to io threads which may lead to > freezeing issue of io threads. > > Here we take the same fix action by treating PF_IO_WORKERS as PF_KTHREAD > within klp_send_signal function. > > Signed-off-by: Dong Kai > --- > note: > the io threads freeze issue links: > [1] https://lore.kernel.org/io-uring/YEgnIp43%2F6kFn8GL@kevinlocke.name/ > [2] https://lore.kernel.org/io-uring/d7350ce7-17dc-75d7-611b-27ebf2cb539b@kernel.dk/ > > kernel/livepatch/transition.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c > index f6310f848f34..0e1c35c8f4b4 100644 > --- a/kernel/livepatch/transition.c > +++ b/kernel/livepatch/transition.c > @@ -358,7 +358,7 @@ static void klp_send_signals(void) > * Meanwhile the task could migrate itself and the action > * would be meaningless. It is not serious though. > */ > - if (task->flags & PF_KTHREAD) { > + if (task->flags & (PF_KTHREAD | PF_IO_WORKER)) { > /* > * Wake up a kthread which sleeps interruptedly and > * still has not been migrated. > (PF_KTHREAD | PF_IO_WORKER) is open coded in soo many places maybe this is a silly question, but... If the livepatch code could use fake_signal_wake_up(), we could consolidate the pattern in klp_send_signals() with the one in freeze_task(). Then there would only one place for wake up / fake signal logic. I don't fully understand the differences in the freeze_task() version, so I only pose this as a question and not v2 request. As it is, this change seems logical to me, so: Acked-by: Joe Lawrence Thanks, -- Joe