Re: [PATCH 19/31] swim: Deduplicate polling loops

Finn Thain <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k
Message-ID <[email protected]>
On Sun, 26 Jul 2026, Laurent Vivier wrote:

> > @@ -373,19 +364,8 @@ static inline void swim_head(struct swim __iomem *base,
> > enum head head)
> >   
> >   static inline int swim_step(struct swim __iomem *base)
> >   {
> > -	int wait;
> > -
> >   	swim_action(base, STEP);
> > -
> > -	for (wait = 0; wait < HZ; wait++) {
> > -
> > -		set_current_state(TASK_INTERRUPTIBLE);
> > -		schedule_timeout(1);
> > -
> > -		if (!swim_readbit(base, STEP))
> > -			return 0;
> > -	}
> > -	return -1;
> > +	return swim_readbit_timeout_atomic(base, STEP, false, 20 * 1000);
> 
> I don't understand why we need _atomic() here.
> 

You're right, it's not needed. This change used to take place before the 
change from spinlock to mutex, but patches were re-arranged and its not 
relevant now. I will address this in v2.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.