From nobody Wed Nov 27 14:32:12 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E07AE18BC36; Wed, 9 Oct 2024 10:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471441; cv=none; b=tQ6Nk6WKr1qVWOrCFAZLTdFmjvaGA0+iDWJf9FxQYCFj65rNWQUYYqcMK0K0xbuAdhhkiEddXVJqAujNy/QR8rLs2Bh9P8G58TD7tGWv7K8H5veOWnMvWir+1FfRM7RBynMi79ozpHalNcTanbOxPcRGASmzDkIUQMstRRLY+XM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471441; c=relaxed/simple; bh=iDWYBrHg5qqjQYVFOvq/CNnwptF+1Qmy7B+kHS/CRMY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EYdwxUpjhgiWXfO9iZgq9xFv/sdhuRAZc5zGx3QFaAs7HjtSh4YQ+9zFRC4JYuNPF7teWajOkeWyCgVAAF2fKLukfIsptMTnWZRdAeVxOY3/nOqVFA9nPo/MVJXQGiue401KwA3xXiP8c4hLGpxnyw5yFFpfjlLgkh5OjUn+Dy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3xRPp7Z5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rvCec705; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3xRPp7Z5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rvCec705" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y7xZ9AA5APDuKqSLhS5SMXynjCeDZ/YuZZ8AnHRWQU8=; b=3xRPp7Z5dbOwZznCmoE1hGomYc6c8I0cuBoaKnr1UJLvC6aAczdXwYUWJLclPG9rlrBToG nWP1dWo2mRAK4xA16pB4Grq3BVo+OQns3kHakl/LkAHhKi1ooR/p3kgyU7iJ54gwXYdXDs FrdyjAz9j7DowypFk4A2CBbmowspQtKfq178b+RcVahKPrGP3sVqVFIqENecZKJCyumfG7 QFlf2j43xeAKjlkmz0jGKZPNujDajfuFAkW3jFr5BLRFhEIXa2WjAsxKrEfogplxhxKDPQ lKshchz/U1EjBqpyo/xjl7m5/9QJtqRXj9xuMbanGHIuz9gHAac21uICjK82bg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y7xZ9AA5APDuKqSLhS5SMXynjCeDZ/YuZZ8AnHRWQU8=; b=rvCec7054qrXJ+ZzLeQG0Nj1CQh4cmBKyKMBG9/1SPPviVEsSM3zNF29vM4+sExGf2+kTx p8wO38M7e+nrogDQ== To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Zijlstra , tglx@linutronix.de, mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ankur.a.arora@oracle.com, efault@gmx.de, Masami Hiramatsu , Mathieu Desnoyers , Sebastian Andrzej Siewior Subject: [PATCH 1/3] tracing: Replace TRACE_FLAG_IRQS_NOSUPPORT with its config option. Date: Wed, 9 Oct 2024 12:50:55 +0200 Message-ID: <20241009105709.887510-2-bigeasy@linutronix.de> In-Reply-To: <20241009105709.887510-1-bigeasy@linutronix.de> References: <20241009105709.887510-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The TRACE_FLAG_IRQS_NOSUPPORT flag is used by tracing_gen_ctx.*() to signal that CONFIG_TRACE_IRQFLAGS_SUPPORT is not enabled and tracing IRQ flags is not supported. This could be replaced by using the 0 as flags and then deducting that there is no IRQFLAGS_SUPPORT based on the config option. The downside is that without CONFIG_TRACE_IRQFLAGS_SUPPORT we can not distinguish between no-IRQ passed flags and callers which passed 0. On the upside we have room for one additional flags which could be used for LAZY_PREEMPTION. Remove TRACE_FLAG_IRQS_NOSUPPORT and set it flags are 0 and CONFIG_TRACE_IRQFLAGS_SUPPORT is not set. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/trace_events.h | 7 +++---- kernel/trace/trace_output.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 42bedcddd5113..d5c0fcf20f024 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -184,8 +184,7 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs= _status); =20 enum trace_flag_type { TRACE_FLAG_IRQS_OFF =3D 0x01, - TRACE_FLAG_IRQS_NOSUPPORT =3D 0x02, - TRACE_FLAG_NEED_RESCHED =3D 0x04, + TRACE_FLAG_NEED_RESCHED =3D 0x02, TRACE_FLAG_HARDIRQ =3D 0x08, TRACE_FLAG_SOFTIRQ =3D 0x10, TRACE_FLAG_PREEMPT_RESCHED =3D 0x20, @@ -211,11 +210,11 @@ static inline unsigned int tracing_gen_ctx(void) =20 static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) { - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); + return tracing_gen_ctx_irq_test(0); } static inline unsigned int tracing_gen_ctx(void) { - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); + return tracing_gen_ctx_irq_test(0); } #endif =20 diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 868f2f912f280..829daa0764dd9 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -460,7 +460,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct tra= ce_entry *entry) (entry->flags & TRACE_FLAG_IRQS_OFF && bh_off) ? 'D' : (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : bh_off ? 'b' : - (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : + !IS_ENABLED(CONFIG_TRACE_IRQFLAGS_SUPPORT) ? 'X' : '.'; =20 switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | --=20 2.45.2 From nobody Wed Nov 27 14:32:12 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0757180A76; Wed, 9 Oct 2024 10:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471441; cv=none; b=ftj4CiM+Lh51bdUBTS6ApqTSQcBuoGJwowWacpSSBKC9A724TxQ8Nt7+tL1Rz4aFXqHugdbfG5gAt3ZLND1tIkbdY4TrG41Ao2KybGdwS4KyGkol3HvP2+00O8kRo/59gO2//k55q1xQePPUwWoXmWtZrkf73W4eCVzHB2LQZd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471441; c=relaxed/simple; bh=MRWe4v3iRf0x+zLdvJD/jJXYRhsIOHffPOS/tq1/X/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UEBRs2uKeS05YP3h/HtQ7nrYYZ3INZOZn4v1w7r5hreh1riI5VIkmP9DPdiIX9vgx2QvIy4CH4n7FVg1QuoKjQU+cdBFjxwy9EfeB2/KQwPxqJSrGvav463bzaDiXVy25xxvp123vJeGh5EpTUHFx7tfFxOtbWgLk3I2m12O8dI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2Ll5+CQr; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YO5pKMjQ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2Ll5+CQr"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YO5pKMjQ" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3+l3+7pthbE+Am32bY9lcPp06P12lLOcWwdrOwYwkoI=; b=2Ll5+CQrPsTB2JuFBRCchw1c/b20akfmvTzD07nBqMtA0rtf9T+3TgydhXTJa8RSogKpt5 YnFwFZODbuqb0b2NWtXaJarW+dZFsubjaqB99Z8UpLCMN2wDkdfdj0j6e/gqmBVpbhfXC9 z7X204qJmp6GjwsULSDflRpYYhX+JlBv4sN94ZZk4wPM5CDP2h4y7LgeFA8dSz1/SigV27 XNNOaHiUaVCd9hH8ayV6hFd2w8xSA+8Lb55orD8T2sS2lqCunIGuR/lEtGFAAVnPkvL/Jp jBBkmiMwoi3qwbUMrpF7rxDXuHAU0WhsGexaTVEdF3H1lw6G5wGTy6pttyVCbA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3+l3+7pthbE+Am32bY9lcPp06P12lLOcWwdrOwYwkoI=; b=YO5pKMjQcWcbEVXFQfjyZ1qgeyKzKQw5XdctkHpUNFMiyPL/IFdEdsse8zdP0RAGdLJHxx Rj40OZpSAZv2TjDQ== To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Zijlstra , tglx@linutronix.de, mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ankur.a.arora@oracle.com, efault@gmx.de, Masami Hiramatsu , Mathieu Desnoyers , Sebastian Andrzej Siewior Subject: [PATCH 2/3] tracing: Record task flag NEED_RESCHED_LAZY. Date: Wed, 9 Oct 2024 12:50:56 +0200 Message-ID: <20241009105709.887510-3-bigeasy@linutronix.de> In-Reply-To: <20241009105709.887510-1-bigeasy@linutronix.de> References: <20241009105709.887510-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The scheduler added NEED_RESCHED_LAZY scheduling. Record this state as part of trace flags and expose it in the need_resched field. Record and expose NEED_RESCHED_LAZY. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Steven Rostedt (Google) --- include/linux/trace_events.h | 1 + kernel/trace/trace.c | 2 ++ kernel/trace/trace_output.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index d5c0fcf20f024..4cae6f2581379 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -185,6 +185,7 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs= _status); enum trace_flag_type { TRACE_FLAG_IRQS_OFF =3D 0x01, TRACE_FLAG_NEED_RESCHED =3D 0x02, + TRACE_FLAG_NEED_RESCHED_LAZY =3D 0x04, TRACE_FLAG_HARDIRQ =3D 0x08, TRACE_FLAG_SOFTIRQ =3D 0x10, TRACE_FLAG_PREEMPT_RESCHED =3D 0x20, diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1c69ca1f10886..29d7703751aa9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2544,6 +2544,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int ir= qs_status) trace_flags |=3D TRACE_FLAG_NEED_RESCHED; if (test_preempt_need_resched()) trace_flags |=3D TRACE_FLAG_PREEMPT_RESCHED; + if (tif_test_bit(TIF_NEED_RESCHED_LAZY)) + trace_flags |=3D TRACE_FLAG_NEED_RESCHED_LAZY; return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) | (min_t(unsigned int, migration_disable_value(), 0xf)) << 4; } diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 829daa0764dd9..23ca2155306b1 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -463,17 +463,29 @@ int trace_print_lat_fmt(struct trace_seq *s, struct t= race_entry *entry) !IS_ENABLED(CONFIG_TRACE_IRQFLAGS_SUPPORT) ? 'X' : '.'; =20 - switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | + switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED= _LAZY | TRACE_FLAG_PREEMPT_RESCHED)) { + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_= PREEMPT_RESCHED: + need_resched =3D 'B'; + break; case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED: need_resched =3D 'N'; break; + case TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED: + need_resched =3D 'L'; + break; + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY: + need_resched =3D 'b'; + break; case TRACE_FLAG_NEED_RESCHED: need_resched =3D 'n'; break; case TRACE_FLAG_PREEMPT_RESCHED: need_resched =3D 'p'; break; + case TRACE_FLAG_NEED_RESCHED_LAZY: + need_resched =3D 'l'; + break; default: need_resched =3D '.'; break; --=20 2.45.2 From nobody Wed Nov 27 14:32:12 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C212B18E028; Wed, 9 Oct 2024 10:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471442; cv=none; b=SN7QPOCo5PmtE8MFaxtBdso6nCpBL3OU6T0Go3ooVpWzfnXfUMuYMlXGvWO8OuWLrG+Tten494jGkmJFN/1WkTedepvp9YHozP2X8oo9TSg69JRpfa+RAza/CauGDJoSu6BIQFgA2iohnSKjbNe2gWqkB5Ws3x5lf49oG2EX4Fc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728471442; c=relaxed/simple; bh=yW0IdweyOm15doJLVg/h0S2faD8U88AwBF3+5UhkGY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lIAdS/IDPqrXdQ8DwVEDGAUI+L3VbQYtQrleWB8sRFxB41fmBarJp9qY6PmCG92aW6FfVtAdIUzQBNUA4dobC+e11d8jz0Lk+crfyW7mP8xJBI1UpgImAiDAnY4I/gFibO8TL5aUYMddXRGgAI/NDL0L1CxCNbetbOoFbNnmGy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Bz++JAuD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=L9sUCqac; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Bz++JAuD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="L9sUCqac" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rMLrliO9lAbb+dJaG2LlaA1SSyEScnNEwlBTF2eF/dI=; b=Bz++JAuDWa3PCULVNbkOYe1NjQAHb4suiUw5KTd/ClMg2LC9b4aJWPRfiNJQwwMvYC+7+Z sl5n5YodQ97tWyKw7NX3aFQRiKq7Uc6rDHfWIlTxb+PHEhQBp+0bFdwqVoP0E7QpkgcLJp U75G3FwnqTQYnAuPn5EijoupkIYyqHIkvk8zVoaRQPlIl7TkpjTwZBR22KVvdEycX6ARYz Lk6X/s5WyK5/YmaogR6qSgTvjremFTMpAN5aR/+hUpsluY/ljxxCOP3eqearkzfpkVKHBA u+2ar/ejibmt6Dw+lrjGipJQAwd0a9Yb6T06ZQ0TfULLidwH2EWMrBM1NIW9eQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728471438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rMLrliO9lAbb+dJaG2LlaA1SSyEScnNEwlBTF2eF/dI=; b=L9sUCqacxH9ZpLdofZVOeTpbD/iXzqiub6ab3qtt8TLPPEQnO4gfx+F15rOYfvQDrwZAux DKTF505J55Kk/XCw== To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Zijlstra , tglx@linutronix.de, mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ankur.a.arora@oracle.com, efault@gmx.de, Masami Hiramatsu , Mathieu Desnoyers , Jisheng Zhang , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, Sebastian Andrzej Siewior Subject: [PATCH 3/3] riscv: add PREEMPT_LAZY support Date: Wed, 9 Oct 2024 12:50:57 +0200 Message-ID: <20241009105709.887510-4-bigeasy@linutronix.de> In-Reply-To: <20241009105709.887510-1-bigeasy@linutronix.de> References: <20241009105709.887510-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jisheng Zhang riscv has switched to GENERIC_ENTRY, so adding PREEMPT_LAZY is as simple as adding TIF_NEED_RESCHED_LAZY related definitions and enabling ARCH_HAS_PREEMPT_LAZY. [bigeasy: Replace old PREEMPT_AUTO bits with new PREEMPT_LAZY ] Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Signed-off-by: Jisheng Zhang Signed-off-by: Sebastian Andrzej Siewior Acked-by: Palmer Dabbelt --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/thread_info.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 62545946ecf43..3516c58480612 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -39,6 +39,7 @@ config RISCV select ARCH_HAS_MMIOWB select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_PMEM_API + select ARCH_HAS_PREEMPT_LAZY select ARCH_HAS_PREPARE_SYNC_CORE_CMD select ARCH_HAS_PTE_DEVMAP if 64BIT && MMU select ARCH_HAS_PTE_SPECIAL diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/= thread_info.h index 9c10fb180f438..8b5a5ddea4293 100644 --- a/arch/riscv/include/asm/thread_info.h +++ b/arch/riscv/include/asm/thread_info.h @@ -107,6 +107,7 @@ int arch_dup_task_struct(struct task_struct *dst, struc= t task_struct *src); * - pending work-to-be-done flags are in lowest half-word * - other flags in upper half-word(s) */ +#define TIF_NEED_RESCHED_LAZY 0 /* Lazy rescheduling needed */ #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ @@ -117,6 +118,7 @@ int arch_dup_task_struct(struct task_struct *dst, struc= t task_struct *src); #define TIF_32BIT 11 /* compat-mode 32bit process */ #define TIF_RISCV_V_DEFER_RESTORE 12 /* restore Vector before returing to = user */ =20 +#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) --=20 2.45.2