Skip to contentSkip to conversation

non-atomic rss_stat modifications

DISCUSSION Dave Jones 2 participants 2 messages Mar 14, 2014 – Mar 17, 2014 Memory management

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 22 lines · Dave Jones

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);
Quoted 2 lines

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.

Signature · 8 lines
Michal Hocko
SUSE Labs

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