From patchwork Fri May 8 21:09:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 26252 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4R0PADs010373 for ; Wed, 27 May 2009 00:25:11 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 4C0A78E00EB; Tue, 26 May 2009 20:25:09 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n48LA0FV032702 for ; Fri, 8 May 2009 17:10:00 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n48L9t63029307; Fri, 8 May 2009 17:09:55 -0400 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.185]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n48L9dSj001002; Fri, 8 May 2009 17:09:40 -0400 Received: by mu-out-0910.google.com with SMTP id i2so628009mue.1 for ; Fri, 08 May 2009 14:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=xL1YJWmV54dlaU6/vQ9B6mM9AS8Y8GU9rO51BgnzuWU=; b=rLyZKuUIfec3PQ6LyznRDzh0iRJRRuSUlDVHdyG+E4+wSxLk3J4fztRfzqD/9MgQjN 8CdugPWUNZaInQOdaDwL+lVoX9MYxWamuQ1PMwrMWOLTJFF02m51CZPa9bdO20Yw9n2H Y8RVCXAcDW8K3C5tagjlWcnicqLnG6P+ex6Ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=BMYO7u0SYtobU03Xl1P8OruouKHV8x4zsE2BVFIyTpoJeO7V1H8txKB7i2VOKTATQa 17WTYSHNwhwY2yhJkNbW7KmMJ2ITT5FLRNkdEGNEbHf7PpL9RnEpdAHa4slroyKabWFl l7x+XjfvZtfV4evOdyl901p3Bet5wzWVr0XLY= Received: by 10.103.6.18 with SMTP id j18mr2601086mui.33.1241816979193; Fri, 08 May 2009 14:09:39 -0700 (PDT) Received: from localhost (host200-68-dynamic.53-82-r.retail.telecomitalia.it [82.53.68.200]) by mx.google.com with ESMTPS id u9sm2048081muf.7.2009.05.08.14.09.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 May 2009 14:09:38 -0700 (PDT) Date: Fri, 8 May 2009 23:09:37 +0200 From: Andrea Righi To: Vivek Goyal Message-ID: <20090508210936.GA5763@linux> References: <1241553525-28095-1-git-send-email-vgoyal@redhat.com> <1241553525-28095-6-git-send-email-vgoyal@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1241553525-28095-6-git-send-email-vgoyal@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-RedHat-Spam-Score: -1.34 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.31 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 26 May 2009 20:25:03 -0400 Cc: dhaval@linux.vnet.ibm.com, snitzer@redhat.com, dm-devel@redhat.com, dpshah@google.com, jens.axboe@oracle.com, agk@redhat.com, balbir@linux.vnet.ibm.com, paolo.valente@unimore.it, guijianfeng@cn.fujitsu.com, fernando@oss.ntt.co.jp, mikew@google.com, jmoyer@redhat.com, nauman@google.com, m-ikeda@ds.jp.nec.com, lizf@cn.fujitsu.com, fchecconi@gmail.com, s-uchida@ap.jp.nec.com, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: [dm-devel] Re: [PATCH 05/18] io-controller: Common hierarchical fair queuing code in elevaotor layer X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com On Tue, May 05, 2009 at 03:58:32PM -0400, Vivek Goyal wrote: > +#define STORE_FUNCTION(__VAR, __MIN, __MAX) \ > +static int io_cgroup_##__VAR##_write(struct cgroup *cgroup, \ > + struct cftype *cftype, \ > + u64 val) \ > +{ \ > + struct io_cgroup *iocg; \ > + struct io_group *iog; \ > + struct hlist_node *n; \ > + \ > + if (val < (__MIN) || val > (__MAX)) \ > + return -EINVAL; \ > + \ > + if (!cgroup_lock_live_group(cgroup)) \ > + return -ENODEV; \ > + \ > + iocg = cgroup_to_io_cgroup(cgroup); \ > + \ > + spin_lock_irq(&iocg->lock); \ > + iocg->__VAR = (unsigned long)val; \ > + hlist_for_each_entry(iog, n, &iocg->group_data, group_node) { \ > + iog->entity.new_##__VAR = (unsigned long)val; \ > + smp_wmb(); \ > + iog->entity.ioprio_changed = 1; \ > + } \ > + spin_unlock_irq(&iocg->lock); \ > + \ > + cgroup_unlock(); \ > + \ > + return 0; \ > +} > + > +STORE_FUNCTION(weight, 0, WEIGHT_MAX); A small fix: io.weight should be strictly greater than 0 if we don't want to automatically trigger the BUG_ON(entity->weight == 0) in bfq_calc_finish(). Signed-off-by: Andrea Righi --- block/elevator-fq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/block/elevator-fq.c b/block/elevator-fq.c index 9500619..de25f44 100644 --- a/block/elevator-fq.c +++ b/block/elevator-fq.c @@ -1136,7 +1136,7 @@ static int io_cgroup_##__VAR##_write(struct cgroup *cgroup, \ return 0; \ } -STORE_FUNCTION(weight, 0, WEIGHT_MAX); +STORE_FUNCTION(weight, 1, WEIGHT_MAX); STORE_FUNCTION(ioprio_class, IOPRIO_CLASS_RT, IOPRIO_CLASS_IDLE); #undef STORE_FUNCTION