mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Ankur Arora <ankur.a.arora@oracle.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	tglx@linutronix.de, paulmck@kernel.org, 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,
	frederic@kernel.org, efault@gmx.de,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH 7/7] powerpc: add support for PREEMPT_LAZY
Date: Sat, 12 Oct 2024 00:05:19 +0530	[thread overview]
Message-ID: <9f0dcdc6-121d-48a7-8abe-b2ce7acd0cdb@linux.ibm.com> (raw)
In-Reply-To: <87jzef7rsx.fsf@oracle.com>



On 10/10/24 23:40, Ankur Arora wrote:
> 
> Sebastian Andrzej Siewior <bigeasy@linutronix.de> writes:
> 
>> On 2024-10-09 09:54:11 [-0700], Ankur Arora wrote:
>>> From: Shrikanth Hegde <sshegde@linux.ibm.com>
>>>
>>> Add PowerPC arch support for PREEMPT_LAZY by defining LAZY bits.
>>>
>>> Since PowerPC doesn't use generic exit to functions, check for
>>> NEED_RESCHED_LAZY when exiting to user or to the kernel from
>>> interrupt routines.
>>>
>>> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
>>> [ Changed TIF_NEED_RESCHED_LAZY to now be defined unconditionally. ]
>>> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
>>> ---
>>>   arch/powerpc/Kconfig                   | 1 +
>>>   arch/powerpc/include/asm/thread_info.h | 5 ++++-
>>>   arch/powerpc/kernel/interrupt.c        | 5 +++--
>>>   3 files changed, 8 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index 8094a01974cc..593a1d60d443 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -270,6 +270,7 @@ config PPC
>>>   	select HAVE_PERF_REGS
>>>   	select HAVE_PERF_USER_STACK_DUMP
>>>   	select HAVE_RETHOOK			if KPROBES
>>> +	select ARCH_HAS_PREEMPT_LAZY
>>>   	select HAVE_REGS_AND_STACK_ACCESS_API
>>>   	select HAVE_RELIABLE_STACKTRACE
>>>   	select HAVE_RSEQ
>>
>> I would move this up to the ARCH_HAS_ block.
> 
> Makes sense.
> 
>>> diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
>>> index 6ebca2996f18..ae7793dae763 100644
>>> --- a/arch/powerpc/include/asm/thread_info.h
>>> +++ b/arch/powerpc/include/asm/thread_info.h
>>> @@ -117,11 +117,14 @@ void arch_setup_new_exec(void);
>>>   #endif
>>>   #define TIF_POLLING_NRFLAG	19	/* true if poll_idle() is polling TIF_NEED_RESCHED */
>>>   #define TIF_32BIT		20	/* 32 bit binary */
>>> +#define TIF_NEED_RESCHED_LAZY	21	/* Lazy rescheduling */
>>
>> I don't see any of the bits being used in assembly anymore.
>> If you group the _TIF_USER_WORK_MASK bits it a single 16 bit block then
>> the compiler could issue a single andi.
> 

That's a good find. since by default powerpc uses 4 byte fixed ISA, 
compiler would generate extra code for _TIF_USER_WORK_MASK. Looked at 
the objdump. It indeed does.

I see that value 9 isn't being used. It was last used for TIF_NOHZ which 
is removed now. That value could be used for RESCHED_LAZY. Using that 
value i see the code generated is similar to what we have now.

+mpe

Ankur, Could you please change the value to 9?
---------------------------------------------------------------------

I see with value 9, andi is used again.

  254:   80 00 dc eb     ld      r30,128(r28)
  258:   4e 62 c9 73     andi.   r9,r30,25166


--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -103,6 +103,7 @@ void arch_setup_new_exec(void);
  #define TIF_PATCH_PENDING      6       /* pending live patching update */
  #define TIF_SYSCALL_AUDIT      7       /* syscall auditing active */
  #define TIF_SINGLESTEP         8       /* singlestepping active */
+#define TIF_NEED_RESCHED_LAZY  9       /* Lazy rescheduling */
  #define TIF_SECCOMP            10      /* secure computing */
  #define TIF_RESTOREALL         11      /* Restore all regs (implies 
NOERROR) */
  #define TIF_NOERROR            12      /* Force successful syscall 
return */
@@ -117,7 +118,6 @@ void arch_setup_new_exec(void);
  #endif
  #define TIF_POLLING_NRFLAG     19      /* true if poll_idle() is 
polling TIF_NEED_RESCHED */
  #define TIF_32BIT              20      /* 32 bit binary */
-#define TIF_NEED_RESCHED_LAZY  21      /* Lazy rescheduling */



  reply	other threads:[~2024-10-11 18:36 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 16:54 [PATCH 0/7] Lazy preemption bits Ankur Arora
2024-10-09 16:54 ` [PATCH 1/7] sched: warn for high latency with TIF_NEED_RESCHED_LAZY Ankur Arora
2024-10-10  6:37   ` Sebastian Andrzej Siewior
2024-10-10 18:19     ` Ankur Arora
2024-10-13  9:44   ` kernel test robot
2024-10-13  9:54   ` kernel test robot
2024-10-16  9:36   ` Shrikanth Hegde
2024-10-21 19:21     ` Ankur Arora
2024-10-22  5:41       ` Shrikanth Hegde
2024-10-09 16:54 ` [PATCH 2/7] rcu: limit PREEMPT_RCU configurations Ankur Arora
2024-10-09 18:01   ` Peter Zijlstra
2024-10-09 18:24     ` Paul E. McKenney
2024-10-09 20:52       ` Peter Zijlstra
2024-10-09 21:16         ` Paul E. McKenney
2024-10-10  7:58           ` Peter Zijlstra
2024-10-10 14:19             ` Paul E. McKenney
2024-10-10  6:32       ` Sebastian Andrzej Siewior
2024-10-10  8:10         ` Peter Zijlstra
2024-10-10  9:13           ` Sebastian Andrzej Siewior
2024-10-10 10:03             ` Peter Zijlstra
2024-10-10 10:26               ` Sebastian Andrzej Siewior
2024-10-10 10:44                 ` Peter Zijlstra
2024-10-10 14:29                   ` Paul E. McKenney
2024-10-11  8:18                     ` Sebastian Andrzej Siewior
2024-10-11 13:59                       ` Paul E. McKenney
2024-10-11 14:43                         ` Sebastian Andrzej Siewior
2024-10-11 15:59                           ` Paul E. McKenney
2024-10-15 11:22                             ` Sebastian Andrzej Siewior
2024-10-15 22:13                               ` Ankur Arora
2024-10-17  8:04                                 ` Sebastian Andrzej Siewior
2024-10-17 22:50                                   ` Ankur Arora
2024-10-18 17:43                                     ` Paul E. McKenney
2024-10-18 19:18                                       ` Ankur Arora
2024-10-18 23:24                                         ` Paul E. McKenney
2024-10-19  1:07                                           ` Ankur Arora
2024-10-19  4:30                                             ` Paul E. McKenney
2024-10-15 23:11                               ` Paul E. McKenney
2024-10-17  7:07                                 ` Sebastian Andrzej Siewior
2024-10-18 17:38                                   ` Paul E. McKenney
2024-10-21 11:27                                     ` Sebastian Andrzej Siewior
2024-10-21 16:48                                       ` Paul E. McKenney
2024-10-21 19:20                                         ` Ankur Arora
2024-10-22 23:49                                           ` Paul E. McKenney
2024-10-22 14:09                                         ` Sebastian Andrzej Siewior
2024-10-22 23:54                                           ` Paul E. McKenney
2024-10-23  6:58                                             ` Sebastian Andrzej Siewior
2024-10-10 17:35             ` Ankur Arora
2024-10-11  7:58               ` Sebastian Andrzej Siewior
2024-10-15 23:01                 ` Ankur Arora
2024-10-10 17:42           ` Ankur Arora
2024-10-09 16:54 ` [PATCH 3/7] rcu: fix header guard for rcu_all_qs() Ankur Arora
2024-10-10  6:41   ` Sebastian Andrzej Siewior
2024-10-10  8:11     ` Peter Zijlstra
2024-10-10 14:29       ` Paul E. McKenney
2024-10-09 16:54 ` [PATCH 4/7] rcu: handle quiescent states for PREEMPT_RCU=n, PREEMPT_COUNT=y Ankur Arora
2024-10-09 19:05   ` Ankur Arora
2024-10-10 14:37     ` Paul E. McKenney
2024-10-10 17:59       ` Ankur Arora
2024-10-10  6:50   ` Sebastian Andrzej Siewior
2024-10-10 17:56     ` Ankur Arora
2024-10-11  7:52       ` Sebastian Andrzej Siewior
2024-10-09 16:54 ` [PATCH 5/7] rcu: rename PREEMPT_AUTO to PREEMPT_LAZY Ankur Arora
2024-10-09 18:02   ` Peter Zijlstra
2024-10-09 18:52     ` Ankur Arora
2024-10-09 16:54 ` [PATCH 6/7] osnoise: handle quiescent states for PREEMPT_RCU=n, PREEMPTION=y Ankur Arora
2024-10-10  6:53   ` Sebastian Andrzej Siewior
2024-10-10 14:39     ` Paul E. McKenney
2024-10-10 17:50     ` Ankur Arora
2024-10-11  7:36       ` Sebastian Andrzej Siewior
2024-10-14 20:14         ` Ankur Arora
2024-10-09 16:54 ` [PATCH 7/7] powerpc: add support for PREEMPT_LAZY Ankur Arora
2024-10-10  7:22   ` Sebastian Andrzej Siewior
2024-10-10 18:10     ` Ankur Arora
2024-10-11 18:35       ` Shrikanth Hegde [this message]
2024-10-12 22:42         ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f0dcdc6-121d-48a7-8abe-b2ce7acd0cdb@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=ankur.a.arora@oracle.com \
    --cc=bigeasy@linutronix.de \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=efault@gmx.de \
    --cc=frederic@kernel.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome