linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* non-atomic rss_stat modifications
@ 2014-03-14  2:17 Dave Jones
  2014-03-17 11:00 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2014-03-14  2:17 UTC (permalink / raw)
  To: linux-mm

I've been trying to make sense of this message which I keep seeing..

BUG: Bad rss-counter state mm:ffff88018bb78000 idx:0 val:1

Looking at the FILEPAGES counter accesses...

$ rgrep FILEPAGES mm
mm/filemap_xip.c:			dec_mm_counter(mm, MM_FILEPAGES);
mm/oom_kill.c:		K(get_mm_counter(victim->mm, MM_FILEPAGES)));
mm/fremap.c:			dec_mm_counter(mm, MM_FILEPAGES);
mm/memory.c:					rss[MM_FILEPAGES]++;
mm/memory.c:			rss[MM_FILEPAGES]++;
mm/memory.c:				rss[MM_FILEPAGES]--;
mm/memory.c:					rss[MM_FILEPAGES]--;
mm/memory.c:	inc_mm_counter_fast(mm, MM_FILEPAGES);
mm/memory.c:				dec_mm_counter_fast(mm, MM_FILEPAGES);
mm/memory.c:			inc_mm_counter_fast(mm, MM_FILEPAGES);
mm/rmap.c:				dec_mm_counter(mm, MM_FILEPAGES);
mm/rmap.c:		dec_mm_counter(mm, MM_FILEPAGES);
mm/rmap.c:		dec_mm_counter(mm, MM_FILEPAGES);


How come we sometimes use the atomic accessors, but in copy_one_pte() and
zap_pte_range() we don't ?  Is that safe ?

	Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: non-atomic rss_stat modifications
  2014-03-14  2:17 non-atomic rss_stat modifications Dave Jones
@ 2014-03-17 11:00 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2014-03-17 11:00 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-mm

On Thu 13-03-14 22:17:45, Dave Jones wrote:
> I've been trying to make sense of this message which I keep seeing..
> 
> BUG: Bad rss-counter state mm:ffff88018bb78000 idx:0 val:1
> 
> Looking at the FILEPAGES counter accesses...
> 
> $ rgrep FILEPAGES mm
> mm/filemap_xip.c:			dec_mm_counter(mm, MM_FILEPAGES);
> mm/oom_kill.c:		K(get_mm_counter(victim->mm, MM_FILEPAGES)));
> mm/fremap.c:			dec_mm_counter(mm, MM_FILEPAGES);
> mm/memory.c:					rss[MM_FILEPAGES]++;
> mm/memory.c:			rss[MM_FILEPAGES]++;
> mm/memory.c:				rss[MM_FILEPAGES]--;
> mm/memory.c:					rss[MM_FILEPAGES]--;
> mm/memory.c:	inc_mm_counter_fast(mm, MM_FILEPAGES);
> mm/memory.c:				dec_mm_counter_fast(mm, MM_FILEPAGES);
> mm/memory.c:			inc_mm_counter_fast(mm, MM_FILEPAGES);
> mm/rmap.c:				dec_mm_counter(mm, MM_FILEPAGES);
> mm/rmap.c:		dec_mm_counter(mm, MM_FILEPAGES);
> mm/rmap.c:		dec_mm_counter(mm, MM_FILEPAGES);
> 
> 
> How come we sometimes use the atomic accessors, but in copy_one_pte() and
> zap_pte_range() we don't ?  Is that safe ?

Those two use a local counter which is then added to the global one. See
copy_pte_range (resp. zap_pte_range) and add_mm_rss_vec they use.

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-17 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-14  2:17 non-atomic rss_stat modifications Dave Jones
2014-03-17 11:00 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox