[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190830154921.GZ2263813@devbig004.ftw2.facebook.com>
Date: Fri, 30 Aug 2019 08:49:21 -0700
From: Tejun Heo <tj@...nel.org>
To: Jan Kara <jack@...e.cz>
Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH block/for-next] writeback: add tracepoints for cgroup
foreign writebacks
Hello, Jan.
On Fri, Aug 30, 2019 at 05:40:23PM +0200, Jan Kara wrote:
> > + TP_fast_assign(
> > + strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
> > + __entry->bdi_id = wb->bdi->id;
> > + __entry->ino = page->mapping->host->i_ino;
> > + __entry->memcg_id = wb->memcg_css->id;
> > + __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
> > + __entry->page_cgroup_ino = page->mem_cgroup->css.cgroup->kn->id.ino;
> > + ),
>
> Are the page dereferences above safe? I suppose lock_page_memcg() protects
> the page->mem_cgroup->css.cgroup->kn->id dereference? But page->mapping
> does not seem to be protected by page lock?
Hah, I assumed it would work because there are preceding if
(page_mapping()) tests in the dirty paths -
e.g. __set_page_dirty_nobuffers(). Oh, regardless of that assumption,
I should have used page_mapping().
Thanks.
--
tejun
Powered by blists - more mailing lists