All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] vmstat-remove-bug_on-from-vmstat_update.patch removed from -mm tree
@ 2016-01-25 18:59 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-01-25 18:59 UTC (permalink / raw)
  To: cl, mhocko, sasha.levin, shiraz.linux.kernel, mm-commits


The patch titled
     Subject: vmstat: remove BUG_ON from vmstat_update
has been removed from the -mm tree.  Its filename was
     vmstat-remove-bug_on-from-vmstat_update.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Christoph Lameter <cl@linux.com>
Subject: vmstat: remove BUG_ON from vmstat_update

If we detect that there is nothing to do just set the flag and do not
check if it was already set before.  Races really do not matter.  If the
flag is set by any code then the shepherd will start dealing with the
situation and reenable the vmstat workers when necessary again.

Since 0eb77e988032 ("vmstat: make vmstat_updater deferrable again and shut
down on idle") quiet_vmstat might update cpu_stat_off and mark a
particular cpu to be handled by vmstat_shepherd.  This might trigger a
VM_BUG_ON in vmstat_update because the work item might have been sleeping
during the idle period and see the cpu_stat_off updated after the wake up.
The VM_BUG_ON is therefore misleading and no more appropriate.  Moreover
it doesn't really suite any protection from real bugs because
vmstat_shepherd will simply reschedule the vmstat_work anytime it sees a
particular cpu set or vmstat_update would do the same from the worker
context directly.  Even when the two would race the result wouldn't be
incorrect as the counters update is fully idempotent.

Fixes: 0eb77e988032 ("vmstat: make vmstat_updater deferrable again and shut down on idle")
Signed-off-by: Christoph Lameter <cl@linux.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Shiraz Hashim <shiraz.linux.kernel@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/vmstat.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff -puN mm/vmstat.c~vmstat-remove-bug_on-from-vmstat_update mm/vmstat.c
--- a/mm/vmstat.c~vmstat-remove-bug_on-from-vmstat_update
+++ a/mm/vmstat.c
@@ -1408,17 +1408,7 @@ static void vmstat_update(struct work_st
 		 * Defer the checking for differentials to the
 		 * shepherd thread on a different processor.
 		 */
-		int r;
-		/*
-		 * Shepherd work thread does not race since it never
-		 * changes the bit if its zero but the cpu
-		 * online / off line code may race if
-		 * worker threads are still allowed during
-		 * shutdown / startup.
-		 */
-		r = cpumask_test_and_set_cpu(smp_processor_id(),
-			cpu_stat_off);
-		VM_BUG_ON(r);
+		cpumask_set_cpu(smp_processor_id(), cpu_stat_off);
 	}
 }
 
_

Patches currently in -mm which might be from cl@linux.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-25 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 18:59 [merged] vmstat-remove-bug_on-from-vmstat_update.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.