Skip to contentSkip to conversation

smp: Remove CSD_FLAG_WAIT flag that's unused

PATCH In review Tim Chen 2 participants 2 messages Feb 27, 2015

lore
Share & tools
lore

Tim Chen

author
#0 lore raw

PATCH 1/1 smp: Remove CSD_FLAG_WAIT flag that's unused

The CSD_FLAG_WAIT is not serving any useful purpose as we do not use its value to decide if we are going to wait for a smp call to complete. We also never cleared it properly when we are done waiting to indicate that the wait is over. So the WARNING debug check in csd_unlock is also not serving useful purpose. Propose here to remove it to clean up the code.

Thanks.

Tim

---
 kernel/smp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
kernel/smp.c +1 -5
index f38a1e6..b65420d 100644
@@ -19,7 +19,6 @@
 
 enum {
 	CSD_FLAG_LOCK		= 0x01,
-	CSD_FLAG_WAIT		= 0x02,
 };
 
 struct call_function_data {
@@ -126,7 +125,7 @@ static void csd_lock(struct call_single_data *csd)
 
 static void csd_unlock(struct call_single_data *csd)
 {
-	WARN_ON((csd->flags & CSD_FLAG_WAIT) && !(csd->flags & CSD_FLAG_LOCK));
+	WARN_ON(!(csd->flags & CSD_FLAG_LOCK));
 
 	/*
 	 * ensure we're all done before releasing data:
@@ -173,9 +172,6 @@ static int generic_exec_single(int cpu, struct call_single_data *csd,
 	csd->func = func;
 	csd->info = info;
 
-	if (wait)
-		csd->flags |= CSD_FLAG_WAIT;
-
 	/*
 	 * The list addition should be visible before sending the IPI
 	 * handler locks the list to pull the entry off it because of
Signature · 1 line
1.9.3
#1 lore raw
Quoted 7 lines · Tim Chen

The CSD_FLAG_WAIT is not serving any useful purpose as we do not use its value to decide if we are going to wait for a smp call to complete. We also never cleared it properly when we are done waiting to indicate that the wait is over. So the WARNING debug check in csd_unlock is also not serving useful purpose. Propose here to remove it to clean up the code.

Linus had a much more comprehensive patch:

http://marc.info/?l=linux-kernel&m=142368734118230