From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Fri, 31 Aug 2018 11:37:59 -0400 From: Josef Bacik To: Dennis Zhou Cc: Jens Axboe , Tejun Heo , Johannes Weiner , Josef Bacik , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/15] blkcg: update blkg_lookup_create to do locking Message-ID: <20180831153757.ztep3tw5j4zmlatm@destiny> References: <20180831015356.69796-1-dennisszhou@gmail.com> <20180831015356.69796-6-dennisszhou@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180831015356.69796-6-dennisszhou@gmail.com> List-ID: On Thu, Aug 30, 2018 at 09:53:46PM -0400, Dennis Zhou wrote: > From: "Dennis Zhou (Facebook)" > > To know when to create a blkg, the general pattern is to do a > blkg_lookup and if that fails, lock and then do a lookup again and if > that fails finally create. It doesn't make much sense for everyone who > wants to do creation to write this themselves. > > This changes blkg_lookup_create to do locking and implement this > pattern. The old blkg_lookup_create is renamed to __blkg_lookup_create. > If a call site wants to do its own error handling or already owns the > queue lock, they can use __blkg_lookup_create. > > Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Thanks, Josef