From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755166Ab2DMQz0 (ORCPT ); Fri, 13 Apr 2012 12:55:26 -0400 Received: from mail-pz0-f52.google.com ([209.85.210.52]:42060 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752Ab2DMQzY (ORCPT ); Fri, 13 Apr 2012 12:55:24 -0400 Date: Fri, 13 Apr 2012 09:55:19 -0700 From: Tejun Heo To: Vivek Goyal Cc: axboe@kernel.dk, ctalbott@google.com, rni@google.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, containers@lists.linux-foundation.org Subject: Re: [PATCH 1/8] blkcg: kill blkio_list and replace blkio_list_lock with a mutex Message-ID: <20120413165519.GA12233@google.com> References: <1334273380-30233-1-git-send-email-tj@kernel.org> <1334273380-30233-2-git-send-email-tj@kernel.org> <20120413133226.GB26383@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120413133226.GB26383@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 13, 2012 at 09:32:26AM -0400, Vivek Goyal wrote: > On Thu, Apr 12, 2012 at 04:29:33PM -0700, Tejun Heo wrote: > > Hi Tejun, > > > @@ -732,20 +732,21 @@ void blkio_policy_register(struct blkio_policy_type *blkiop) > > { > > struct request_queue *q; > > > > + mutex_lock(&blkcg_pol_mutex); > > + > > blkcg_bypass_start(); > > - spin_lock(&blkio_list_lock); > > > > BUG_ON(blkio_policy[blkiop->plid]); > > A minor nit. It might be a good idea to check that blkiop->plid is not > greater than BLKIO_NR_POLICIES for both registration and unresitration > functions to avoid touching memory beyond blkio_policy[] array. I'm making ->plid to be dynamically allocated on registration anyway, so I don't think it really matters. The updated unregistration function does BUG_ON(blkio_policy[pol->plid] != pol) which should catch stray plid. Thanks. -- tejun