lkml.org 
[lkml]   [2020]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] sched/fair: remove the spin_lock operations
Date
From: Benjamin Segall
> Sent: 30 October 2020 18:48
>
> Hui Su <sh_def@163.com> writes:
>
> > Since 'ab93a4bc955b ("sched/fair: Remove
> > distribute_running fromCFS bandwidth")',there is
> > nothing to protect between raw_spin_lock_irqsave/store()
> > in do_sched_cfs_slack_timer().
> >
> > So remove it.
>
> Reviewed-by: Ben Segall <bsegall@google.com>
>
> (I might nitpick the subject to be clear that it should be trivial
> because the lock area is empty, or call them dead or something, but it's
> not all that important)

I don't know about this case, but a lock+unlock can be used
to ensure that nothing else holds the lock when acquiring
the lock requires another lock be held.

So if the normal sequence is:
lock(table)
# lookup item
lock(item)
unlock(table)
....
unlock(item)

Then it can make sense to do:
lock(table)
lock(item)
unlock(item)
....
unlock(table)

although that ought to deserve a comment.

avid

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2020-10-30 23:17    [W:0.115 / U:2.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site