Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4289123pxb; Thu, 14 Oct 2021 02:15:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMl5PKNY8yvxd82o7XiQUC5VvlTS7RMYtqlMlVjkSZbSJuUR7lIhEzEX8/sQVVIn3Tfptj X-Received: by 2002:a63:b54b:: with SMTP id u11mr3285706pgo.163.1634202905505; Thu, 14 Oct 2021 02:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634202905; cv=none; d=google.com; s=arc-20160816; b=z5KZ5wXWNDOWtzbgiEhe3Y5HyQri4lxZPz8Nfj3nZJkbDiPd3f24XGL0Ix2WVPJRTH +7+txci5Ali94u/DbeUcLzNaa+JDRco1Z377kbfPIMcifjq7XqcyeDcz9ZpQspedyEc2 DSE557LhspkSZ9u+Bunh4YWeB4KhPwa5zBihoEWTFm9NwlpnsAFvj2kUm7i8rjVSZTmg 8gFgD6b6397exr/uAc2Nilubs/KeJc7GmhO0D0Muqcj+gjanJImqxinjszjPYbigCiBy z4eNb+CfhUYCBGbZLiT81OAYov2V0L10Hwdf+skfX7w90G20j0dsRLcznfq8TwxITQFk JNoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=6qlO0B+dKVbDjD2ahAupf74QzcuBtOf+3HozXO78zVI=; b=MQo42jVezJdG6THY2g4KyVmCFUgGI5jhhdDRr7JLOy5r5N10zp0t/mcJxM1zmKqbZH zU4Vqm7ox2Zv/vZ3XmZBQNK549mKNnLoBKWsqVEOULX+XQNi34X47i2H8GsJZGjes1Ep N9J49BqWKBwxXV7IS1ak0l1cp8dFa+ePEH4m83Jbrld0s3PCr5bwMltsVEb3cQx+XjVf FY7m73lRMkrd1+pv23XFFzzGzfm8NBPp8t+zfObyCSnQKgl7mSbLom1Vu1L/PYZ4yhxT K5chkd1LMFHHCzZdj9I4/mZDpcnrg+50ZxILIpnsBtzr5fwHQr0lXj0TrRZm4AoLVyf2 Yzgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TNcMw28J; dkim=neutral (no key) header.i=@suse.cz; 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 s4si2984447plg.431.2021.10.14.02.14.52; Thu, 14 Oct 2021 02:15:05 -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=@suse.cz header.s=susede2_rsa header.b=TNcMw28J; dkim=neutral (no key) header.i=@suse.cz; 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 S230128AbhJNJPZ (ORCPT + 99 others); Thu, 14 Oct 2021 05:15:25 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:34094 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbhJNJPW (ORCPT ); Thu, 14 Oct 2021 05:15:22 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 1619621A78; Thu, 14 Oct 2021 09:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634202796; h=from:from:reply-to: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=6qlO0B+dKVbDjD2ahAupf74QzcuBtOf+3HozXO78zVI=; b=TNcMw28JoUbqZZrjTwmFLWtEVPnNV5ytCnksIJIdcU85oBHx2uqflkwC21OnsmYSMeNEMC kYFkvf6iLxxdWYUsCUjTTstLSlPXR1+HgAuC5TKPtflyHbB0YnOvbj/4sp7TYCc11H5GiQ 3hThb2kfKCZXvj271cl6oZ0iXmz+5fw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634202796; h=from:from:reply-to: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=6qlO0B+dKVbDjD2ahAupf74QzcuBtOf+3HozXO78zVI=; b=F4BaV/k078gUywEn1Kt9pDnKXJaHdraB0NCigBl7LVC2HzjgwcBlCnC3EArFqzS4fQ7Sjb P9TBANAUA3ey+kBw== Received: from pobox.suse.cz (pobox.suse.cz [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A7F0BA3B8B; Thu, 14 Oct 2021 09:13:13 +0000 (UTC) Date: Thu, 14 Oct 2021 11:13:13 +0200 (CEST) From: Miroslav Benes To: =?ISO-2022-JP?Q?=1B$B2&lV=1B=28J?= cc: Guo Ren , Steven Rostedt , Ingo Molnar , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Josh Poimboeuf , Jiri Kosina , Petr Mladek , Joe Lawrence , Colin Ian King , Masami Hiramatsu , "Peter Zijlstra (Intel)" , Nicholas Piggin , Jisheng Zhang , linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, live-patching@vger.kernel.org Subject: Re: [PATCH v3 1/2] ftrace: disable preemption between ftrace_test_recursion_trylock/unlock() In-Reply-To: <7e4738b5-21d4-c4d0-3136-a096bbb5cd2c@linux.alibaba.com> Message-ID: References: <609b565a-ed6e-a1da-f025-166691b5d994@linux.alibaba.com> <7e4738b5-21d4-c4d0-3136-a096bbb5cd2c@linux.alibaba.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c > index e8029ae..b8d75fb 100644 > --- a/kernel/livepatch/patch.c > +++ b/kernel/livepatch/patch.c > @@ -49,14 +49,16 @@ static void notrace klp_ftrace_handler(unsigned long ip, > > ops = container_of(fops, struct klp_ops, fops); > > + /* > + * This empty line is not useful. > + * The ftrace_test_recursion_trylock() will disable preemption, > + * which is required for the variant of synchronize_rcu() that is > + * used to allow patching functions where RCU is not watching. > + * See klp_synchronize_transition() for more details. > + */ > bit = ftrace_test_recursion_trylock(ip, parent_ip); > if (WARN_ON_ONCE(bit < 0)) > return; > - /* > - * A variant of synchronize_rcu() is used to allow patching functions > - * where RCU is not watching, see klp_synchronize_transition(). > - */ > - preempt_disable_notrace(); > > func = list_first_or_null_rcu(&ops->func_stack, struct klp_func, > stack_node); > @@ -120,7 +122,6 @@ static void notrace klp_ftrace_handler(unsigned long ip, > klp_arch_set_pc(fregs, (unsigned long)func->new_func); > > unlock: > - preempt_enable_notrace(); > ftrace_test_recursion_unlock(bit); > } Acked-by: Miroslav Benes for the livepatch part of the patch. I would also ask you not to submit new versions so often, so that the other reviewers have time to actually review the patch set. Quoting from Documentation/process/submitting-patches.rst: "Wait for a minimum of one week before resubmitting or pinging reviewers - possibly longer during busy times like merge windows." Thanks Miroslav