Re: [PATCH v17 17/21] mm/lru: replace pgdat lru_lock with lruvec lock

Alex Shi
2020-07-29T00:48:00Z

在 2020/7/28 下午11:55, Alexander Duyck 写道:
>> /*
>> @@ -511,11 +511,11 @@ static bool compact_lock_irqsave(spinlock_t *lock, unsigned long *flags,
>> * scheduled)
>> */
>> static bool compact_unlock_should_abort(spinlock_t *lock,
>> - unsigned long flags, bool *locked, struct compact_control *cc)
>> + unsigned long flags, void **locked, struct compact_control *cc)
> Instead of passing both a void pointer and the lock why not just pass
> the pointer to the lock pointer? You could combine lock and locked
> into a single argument and save yourself some extra effort.
>

the passed locked pointer could be rewrite in the func, that is unacceptable if it is a lock which could
be used other place.

And it is alreay dangerous to NULL a local pointer. In fact, I perfer the orignal verion, not so smart
but rebust enough for future changes, right?

Thanks
Alex

>> {
>> if (*locked) {
>> spin_unlock_irqrestore(lock, flags);
>> - *locked = false;
>> + *locked = NULL;
>> }
>>
>> if (fatal_signal_pending(current)) {