From: Christoph Hellwig <hch@lst.de>
To: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>,
Andrew Morton <akpm@linux-foundation.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 5/5] mm: simplify bdi refcounting
Date: Wed, 27 Oct 2021 09:42:07 +0200 [thread overview]
Message-ID: <20211027074207.GA12793@lst.de> (raw)
In-Reply-To: <20211022090203.GF1026@quack2.suse.cz>
On Fri, Oct 22, 2021 at 11:02:03AM +0200, Jan Kara wrote:
> On Thu 21-10-21 14:44:41, Christoph Hellwig wrote:
> > Move grabbing and releasing the bdi refcount out of the common
> > wb_init/wb_exit helpers into code that is only used for the non-default
> > memcg driven bdi_writeback structures.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Can we perhaps add a comment to struct bdi_writeback definition (or maybe
> wb_init()?) mentioning that it holds a reference to 'bdi' if it is
> bdi_writeback struct for a cgroup? I don't see it mentioned anywhere and
> now that you've changed the code, it isn't that obvious from the code
> either... Otherwise the patch looks good so feel free to add:
Like this?
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 33207004cfded..a3d7dd1cc30a1 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -103,6 +103,9 @@ struct wb_completion {
* change as blkcg is disabled and enabled higher up in the hierarchy, a wb
* is tested for blkcg after lookup and removed from index on mismatch so
* that a new wb for the combination can be created.
+ *
+ * Each bdi_writeback that is no embedded into the backing_dev_info must hold
+ * a reference to the parent backing_dev_info. See cgwb_create() for details.
*/
struct bdi_writeback {
struct backing_dev_info *bdi; /* our parent bdi */
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>,
Andrew Morton <akpm@linux-foundation.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 5/5] mm: simplify bdi refcounting
Date: Wed, 27 Oct 2021 09:42:07 +0200 [thread overview]
Message-ID: <20211027074207.GA12793@lst.de> (raw)
In-Reply-To: <20211022090203.GF1026@quack2.suse.cz>
On Fri, Oct 22, 2021 at 11:02:03AM +0200, Jan Kara wrote:
> On Thu 21-10-21 14:44:41, Christoph Hellwig wrote:
> > Move grabbing and releasing the bdi refcount out of the common
> > wb_init/wb_exit helpers into code that is only used for the non-default
> > memcg driven bdi_writeback structures.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Can we perhaps add a comment to struct bdi_writeback definition (or maybe
> wb_init()?) mentioning that it holds a reference to 'bdi' if it is
> bdi_writeback struct for a cgroup? I don't see it mentioned anywhere and
> now that you've changed the code, it isn't that obvious from the code
> either... Otherwise the patch looks good so feel free to add:
Like this?
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 33207004cfded..a3d7dd1cc30a1 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -103,6 +103,9 @@ struct wb_completion {
* change as blkcg is disabled and enabled higher up in the hierarchy, a wb
* is tested for blkcg after lookup and removed from index on mismatch so
* that a new wb for the combination can be created.
+ *
+ * Each bdi_writeback that is no embedded into the backing_dev_info must hold
+ * a reference to the parent backing_dev_info. See cgwb_create() for details.
*/
struct bdi_writeback {
struct backing_dev_info *bdi; /* our parent bdi */
next prev parent reply other threads:[~2021-10-27 7:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 12:44 simplify bdi unregistation Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-21 12:44 ` [PATCH 1/5] mm: export bdi_unregister Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-22 8:41 ` Jan Kara
2021-10-22 8:41 ` Jan Kara
2021-10-21 12:44 ` [PATCH 2/5] mtd: call bdi_unregister explicitly Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-22 8:43 ` Jan Kara
2021-10-22 8:43 ` Jan Kara
2021-10-21 12:44 ` [PATCH 3/5] fs: explicitly unregister per-superblock BDIs Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-22 8:48 ` Jan Kara
2021-10-22 8:48 ` Jan Kara
2021-10-21 12:44 ` [PATCH 4/5] mm: don't automatically unregister bdis Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-22 8:51 ` Jan Kara
2021-10-22 8:51 ` Jan Kara
2021-10-21 12:44 ` [PATCH 5/5] mm: simplify bdi refcounting Christoph Hellwig
2021-10-21 12:44 ` Christoph Hellwig
2021-10-22 9:02 ` Jan Kara
2021-10-22 9:02 ` Jan Kara
2021-10-27 7:42 ` Christoph Hellwig [this message]
2021-10-27 7:42 ` Christoph Hellwig
2021-10-27 9:47 ` Jan Kara
2021-10-27 9:47 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211027074207.GA12793@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.