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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D667EC77B76 for ; Tue, 18 Apr 2023 12:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbjDRMQg (ORCPT ); Tue, 18 Apr 2023 08:16:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbjDRMQc (ORCPT ); Tue, 18 Apr 2023 08:16:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4FA73580 for ; Tue, 18 Apr 2023 05:16:14 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681820172; 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=SbfVCxQkPCMEbMiCeEKOWEBgvAaqYdww9xSC7ukJlN0=; b=sw4bDGCqlcYiJsWKnNpRtww2/uFO4heCem2hznP04bzy8vFvEWmfIwXJtJqBBjDgCiz+Mb T+iaE6ozzkRqPkphNpz2HpgawcyqLbxuhH7u5RKj3flWYQu675fs0p6sRXFVvSDi5kywMA /M9oM2GcrTMXYfiocynvipoe1cb84d2OlRBwQ1uGCsYcqGn33jgWmmUFeMDeqAeMTV0xMO E2gIqdRm78rkmlThWP1CfIoZfK0/aklnlk5+563gJti/Zw0eU3B4o1eunAE+xHuBM3h+pG kf+R0OEp0dKOdZhEXF3AjxAERmu/DQjRtWiwJxB9id3RuNYO6ys7XN5Sn0MBgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681820172; 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=SbfVCxQkPCMEbMiCeEKOWEBgvAaqYdww9xSC7ukJlN0=; b=ktHPUesE5gTBgC2r0/03ayhPF1qLzLdA5OmmM/rOi5psNuO1sPZp8v/InZ35hb6Z+e6gX6 IQcawWjYsuPy49Bw== To: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org Cc: Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Valentin Schneider , Vincent Guittot Subject: Re: [PATCH RFC] preempt: Put preempt_enable() within an instrumentation*() section. In-Reply-To: <20230309072724.3F6zRkvw@linutronix.de> References: <20230309072724.3F6zRkvw@linutronix.de> Date: Tue, 18 Apr 2023 14:16:11 +0200 Message-ID: <87fs8x4c8k.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 09 2023 at 08:27, Sebastian Andrzej Siewior wrote: > Callers of preempt_enable() can be within an noinstr section leading to: > | vmlinux.o: warning: objtool: native_sched_clock+0x97: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: kvm_clock_read+0x22: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: local_clock+0xb4: call to preempt_schedule_notrace_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: enter_from_user_mode+0xea: call to preempt_schedule_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x140: call to preempt_schedule_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0xf2: call to preempt_schedule_thunk() leaves .noinstr.text section > | vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0xea: call to preempt_schedule_thunk() leaves .noinstr.text section I'm confused where this preempt_enable is in those *_enter_from_user_mode() functions. Kernel config and compiler version please. > #define preempt_enable() \ > do { \ > barrier(); \ > - if (unlikely(preempt_count_dec_and_test())) \ > + if (unlikely(preempt_count_dec_and_test())) { \ > + instrumentation_begin(); \ > __preempt_schedule(); \ > + instrumentation_end(); \ > + } \ > } while (0) This would paper over a misplaced preempt_disable/enable() pair in noinstr code. I'm not really happy about that. Thanks, tglx