From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fengguang Wu Subject: Re: [Lsf] [RFC] writeback and cgroup Date: Tue, 17 Apr 2012 10:14:24 +0800 Message-ID: <20120417021424.GA9418@localhost> References: <20120407080027.GA2584@quack.suse.cz> <20120410180653.GJ21801@redhat.com> <20120410210505.GE4936@quack.suse.cz> <20120410212041.GP21801@redhat.com> <20120410222425.GF4936@quack.suse.cz> <20120411154005.GD16692@redhat.com> <1334406314.2528.90.camel@twins> <20120416125432.GB12776@redhat.com> <20120416130707.GA10532@localhost> <20120416155207.GB15437@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20120416155207.GB15437-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Vivek Goyal Cc: ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, andrea-oIIqvOZpAevzfdHfmsDf5w@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lsf-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: containers.vger.kernel.org On Mon, Apr 16, 2012 at 11:52:07AM -0400, Vivek Goyal wrote: > On Mon, Apr 16, 2012 at 09:07:07PM +0800, Fengguang Wu wrote: > > [..] > > Vivek, I noticed these lines in cfq code > > > > sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor); > > > > Why not use bdi->dev->devt? The problem is that dev_name() will > > return "btrfs-X" for btrfs rather than "major:minor". > > Isn't bdi->dev->devt 0? I see following code. > > add_disk() > bdi_register_dev() > bdi_register() > device_create_vargs(MKDEV(0,0)) > dev->devt = devt = MKDEV(0,0); > > So for normal block devices, I think bdi->dev->devt will be zero, that's > why probably we don't use it. Yes indeed. I can confirm this with tracing. There are two main cases - some filesystems do not have a real device for the bdi. - add_disk() calls bdi_register_dev() with the devt, however this information is not passed down for some reason. device_create_vargs() will try to create a sysfs dev file if the devt is not MKDEV(0,0). Thanks, Fengguang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755909Ab2DQCTl (ORCPT ); Mon, 16 Apr 2012 22:19:41 -0400 Received: from mga01.intel.com ([192.55.52.88]:49208 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754488Ab2DQCTj (ORCPT ); Mon, 16 Apr 2012 22:19:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="142538865" Date: Tue, 17 Apr 2012 10:14:24 +0800 From: Fengguang Wu To: Vivek Goyal Cc: Peter Zijlstra , ctalbott@google.com, rni@google.com, andrea@betterlinux.com, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, lsf@lists.linux-foundation.org, linux-mm@kvack.org, jmoyer@redhat.com, lizefan@huawei.com, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [Lsf] [RFC] writeback and cgroup Message-ID: <20120417021424.GA9418@localhost> References: <20120407080027.GA2584@quack.suse.cz> <20120410180653.GJ21801@redhat.com> <20120410210505.GE4936@quack.suse.cz> <20120410212041.GP21801@redhat.com> <20120410222425.GF4936@quack.suse.cz> <20120411154005.GD16692@redhat.com> <1334406314.2528.90.camel@twins> <20120416125432.GB12776@redhat.com> <20120416130707.GA10532@localhost> <20120416155207.GB15437@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120416155207.GB15437@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2012 at 11:52:07AM -0400, Vivek Goyal wrote: > On Mon, Apr 16, 2012 at 09:07:07PM +0800, Fengguang Wu wrote: > > [..] > > Vivek, I noticed these lines in cfq code > > > > sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor); > > > > Why not use bdi->dev->devt? The problem is that dev_name() will > > return "btrfs-X" for btrfs rather than "major:minor". > > Isn't bdi->dev->devt 0? I see following code. > > add_disk() > bdi_register_dev() > bdi_register() > device_create_vargs(MKDEV(0,0)) > dev->devt = devt = MKDEV(0,0); > > So for normal block devices, I think bdi->dev->devt will be zero, that's > why probably we don't use it. Yes indeed. I can confirm this with tracing. There are two main cases - some filesystems do not have a real device for the bdi. - add_disk() calls bdi_register_dev() with the devt, however this information is not passed down for some reason. device_create_vargs() will try to create a sysfs dev file if the devt is not MKDEV(0,0). Thanks, Fengguang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx105.postini.com [74.125.245.105]) by kanga.kvack.org (Postfix) with SMTP id ECF0D6B007E for ; Mon, 16 Apr 2012 22:19:38 -0400 (EDT) Date: Tue, 17 Apr 2012 10:14:24 +0800 From: Fengguang Wu Subject: Re: [Lsf] [RFC] writeback and cgroup Message-ID: <20120417021424.GA9418@localhost> References: <20120407080027.GA2584@quack.suse.cz> <20120410180653.GJ21801@redhat.com> <20120410210505.GE4936@quack.suse.cz> <20120410212041.GP21801@redhat.com> <20120410222425.GF4936@quack.suse.cz> <20120411154005.GD16692@redhat.com> <1334406314.2528.90.camel@twins> <20120416125432.GB12776@redhat.com> <20120416130707.GA10532@localhost> <20120416155207.GB15437@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120416155207.GB15437@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Vivek Goyal Cc: Peter Zijlstra , ctalbott@google.com, rni@google.com, andrea@betterlinux.com, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, lsf@lists.linux-foundation.org, linux-mm@kvack.org, jmoyer@redhat.com, lizefan@huawei.com, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org On Mon, Apr 16, 2012 at 11:52:07AM -0400, Vivek Goyal wrote: > On Mon, Apr 16, 2012 at 09:07:07PM +0800, Fengguang Wu wrote: > > [..] > > Vivek, I noticed these lines in cfq code > > > > sscanf(dev_name(bdi->dev), "%u:%u", &major, &minor); > > > > Why not use bdi->dev->devt? The problem is that dev_name() will > > return "btrfs-X" for btrfs rather than "major:minor". > > Isn't bdi->dev->devt 0? I see following code. > > add_disk() > bdi_register_dev() > bdi_register() > device_create_vargs(MKDEV(0,0)) > dev->devt = devt = MKDEV(0,0); > > So for normal block devices, I think bdi->dev->devt will be zero, that's > why probably we don't use it. Yes indeed. I can confirm this with tracing. There are two main cases - some filesystems do not have a real device for the bdi. - add_disk() calls bdi_register_dev() with the devt, however this information is not passed down for some reason. device_create_vargs() will try to create a sysfs dev file if the devt is not MKDEV(0,0). Thanks, Fengguang -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org