Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1321886 > unrolled thread

Re: [PATCH 1/5] mm: memcontrol: generalize locking for the page->mem_cgroup binding

Started byJohannes Weiner <hannes@cmpxchg.org>
First post2016-01-29 17:50 +0100
Last post2016-01-29 17:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/5] mm: memcontrol: generalize locking for the  page->mem_cgroup binding Johannes Weiner <hannes@cmpxchg.org> - 2016-01-29 17:50 +0100

#1321886 — Re: [PATCH 1/5] mm: memcontrol: generalize locking for the page->mem_cgroup binding

FromJohannes Weiner <hannes@cmpxchg.org>
Date2016-01-29 17:50 +0100
SubjectRe: [PATCH 1/5] mm: memcontrol: generalize locking for the page->mem_cgroup binding
Message-ID<qWkpd-5W2-27@gated-at.bofh.it>
On Wed, Jan 27, 2016 at 05:30:45PM +0300, Vladimir Davydov wrote:
> On Tue, Jan 26, 2016 at 04:00:02PM -0500, Johannes Weiner wrote:
> 
> > @@ -683,17 +683,17 @@ int __set_page_dirty_buffers(struct page *page)
> >  		} while (bh != head);
> >  	}
> >  	/*
> > -	 * Use mem_group_begin_page_stat() to keep PageDirty synchronized with
> > -	 * per-memcg dirty page counters.
> > +	 * Lock out page->mem_cgroup migration to keep PageDirty
> > +	 * synchronized with per-memcg dirty page counters.
> >  	 */
> > -	memcg = mem_cgroup_begin_page_stat(page);
> > +	memcg = lock_page_memcg(page);
> >  	newly_dirty = !TestSetPageDirty(page);
> >  	spin_unlock(&mapping->private_lock);
> >  
> >  	if (newly_dirty)
> >  		__set_page_dirty(page, mapping, memcg, 1);
> 
> Do we really want to pass memcg to __set_page_dirty and then to
> account_page_dirtied, increasing stack/regs usage even in case memory
> cgroup is disabled? May be, it'd be better to make
> mem_cgroup_update_page_stat take a page instead of a memcg?

I'll look into that. It will need changing migration to leave the
page->mem_cgroup binding of live pages alone, but that's something
worth doing anyway. It's beyond the scope of these patches, though.

Thanks

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web