Re: [PATCH 06/13] locking/qspinlock: merge qspinlock_paravirt.h into qspinlock.c

From: Waiman Long
Date: Wed Jul 06 2022 - 09:36:03 EST


On 7/5/22 13:20, Peter Zijlstra wrote:
On Tue, Jul 05, 2022 at 12:38:13AM +1000, Nicholas Piggin wrote:
There isn't much reason to keep these separate.
The reason was so that other paravirt implementations could be added.

The CNA thing was also implemented this way...

Do you have any plan to take CNA [1] some time in the future?

Anyway, the main reason the paravirt code is separated into a separated file is to leave only the core part in qspinlock.c so that new users are overwhelmed with the messy details for the paravirt code. Putting everything into a single can make it harder to read for the newbies.

Also eliminating the preprocessor trick will make it harder to integrate a different qspinlock variant, like CNA, into the code base.

Cheers,
Longman

[1] https://lore.kernel.org/lkml/20210514200743.3026725-1-alex.kogan@xxxxxxxxxx/