From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B985CC433E0 for ; Mon, 29 Mar 2021 13:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E4AE61960 for ; Mon, 29 Mar 2021 13:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhC2NqI (ORCPT ); Mon, 29 Mar 2021 09:46:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58022 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbhC2Npo (ORCPT ); Mon, 29 Mar 2021 09:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617025543; 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=0y2XlpOQ1zPIm8nre1SSlzdpsIZsBs0a+WqNhPR+L+k=; b=OV9GAZtOsyP7jyjSWLtjnDKG1tny9xHNedh5N3RH0FgE7sYIxk/fsDmrtBkJ4oKcXlBvIk mVKElFGT1ZYcHF17EJtMLLM9L1VeVfhOQk9ayLw03t22kyDiZw1+OiF+ecio9x4F6VUb1u 3H3+tjieTU3lxGOLI2c68sB8k2zr92k= 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-545-FMEv17uKOpSmyn2AsymNJA-1; Mon, 29 Mar 2021 09:45:41 -0400 X-MC-Unique: FMEv17uKOpSmyn2AsymNJA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED4BA84B9A0; Mon, 29 Mar 2021 13:45:39 +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 5309560CFB; Mon, 29 Mar 2021 13:45:38 +0000 (UTC) Subject: Re: [PATCH v2] livepatch: Replace the fake signal sending with TIF_NOTIFY_SIGNAL infrastructure To: Miroslav Benes , jpoimboe@redhat.com, jikos@kernel.org, pmladek@suse.com Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk References: <20210329132815.10035-1-mbenes@suse.cz> From: Joe Lawrence Message-ID: Date: Mon, 29 Mar 2021 09:45:37 -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: <20210329132815.10035-1-mbenes@suse.cz> 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.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/21 9:28 AM, Miroslav Benes wrote: > Livepatch sends a fake signal to all remaining blocking tasks of a > running transition after a set period of time. It uses TIF_SIGPENDING > flag for the purpose. Commit 12db8b690010 ("entry: Add support for > TIF_NOTIFY_SIGNAL") added a generic infrastructure to achieve the same. > Replace our bespoke solution with the generic one. > > Reviewed-by: Jens Axboe > Reviewed-by: Petr Mladek > Signed-off-by: Miroslav Benes > --- > v2: > - #include from kernel/signal.c removed [Petr] > > kernel/livepatch/transition.c | 5 ++--- > kernel/signal.c | 4 +--- > 2 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c > index f6310f848f34..3a4beb9395c4 100644 > --- a/kernel/livepatch/transition.c > +++ b/kernel/livepatch/transition.c > @@ -9,6 +9,7 @@ > > #include > #include > +#include > #include "core.h" > #include "patch.h" > #include "transition.h" > @@ -369,9 +370,7 @@ static void klp_send_signals(void) > * Send fake signal to all non-kthread tasks which are > * still not migrated. > */ > - spin_lock_irq(&task->sighand->siglock); > - signal_wake_up(task, 0); > - spin_unlock_irq(&task->sighand->siglock); > + set_notify_signal(task); > } > } > read_unlock(&tasklist_lock); > diff --git a/kernel/signal.c b/kernel/signal.c > index f2a1b898da29..604290a8ca89 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -43,7 +43,6 @@ > #include > #include > #include > -#include > #include > #include > > @@ -181,8 +180,7 @@ void recalc_sigpending_and_wake(struct task_struct *t) > > void recalc_sigpending(void) > { > - if (!recalc_sigpending_tsk(current) && !freezing(current) && > - !klp_patch_pending(current)) > + if (!recalc_sigpending_tsk(current) && !freezing(current)) > clear_thread_flag(TIF_SIGPENDING); > > } > Looks good to me. Thanks for checking on this and updating. Acked-by: Joe Lawrence -- Joe