All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [GIT PULL rcu/next] RCU commits for 3.1
From: Paul E. McKenney @ 2011-10-31  9:32 UTC (permalink / raw)
  To: Li Zefan
  Cc: Ingo Molnar, eric.dumazet, shaohua.li, ak, mhocko, alex.shi,
	efault, linux-kernel, Peter Zijlstra, Paul Turner
In-Reply-To: <4EAE57AF.1060706@cn.fujitsu.com>

On Mon, Oct 31, 2011 at 04:09:19PM +0800, Li Zefan wrote:
> (Let's cc Peter and Paul Turner for this perf cgroup issue.)
> 
> > Thank you for the analysis.  Does the following patch fix this problem?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > fs: Add RCU protection in set_task_comm()
> > 
> > Running "perf stat true" results in the following RCU-lockdep splat:
> > 
> > ===============================
> > [ INFO: suspicious RCU usage. ]
> > -------------------------------
> > include/linux/cgroup.h:548 suspicious rcu_dereference_check() usage!
> > 
> > other info that might help us debug this:
> > 
> > rcu_scheduler_active = 1, debug_locks = 0
> > 1 lock held by true/655:
> > #0:  (&sig->cred_guard_mutex){+.+.+.}, at: [<810d1bd7>] prepare_bprm_creds+0x27/0x70
> > 
> > stack backtrace:
> > Pid: 655, comm: true Not tainted 3.1.0-tip-01868-g1271bd2-dirty #161079
> > Call Trace:
> > [<81abe239>] ? printk+0x18/0x1a
> > [<81064920>] lockdep_rcu_suspicious+0xc0/0xd0
> > [<8108aa02>] perf_event_enable_on_exec+0x1d2/0x1e0
> > [<81063764>] ? __lock_release+0x54/0xb0
> > [<8108cca8>] perf_event_comm+0x18/0x60
> > [<810d1abd>] ? set_task_comm+0x5d/0x80
> > [<81af622d>] ? _raw_spin_unlock+0x1d/0x40
> > [<810d1ac4>] set_task_comm+0x64/0x80
> > [<810d25fd>] setup_new_exec+0xbd/0x1d0
> > [<810d1b61>] ? flush_old_exec+0x81/0xa0
> > [<8110753e>] load_elf_binary+0x28e/0xa00
> > [<810d2101>] ? search_binary_handler+0xd1/0x1d0
> > [<81063764>] ? __lock_release+0x54/0xb0
> > [<811072b0>] ? load_elf_library+0x260/0x260
> > [<810d2108>] search_binary_handler+0xd8/0x1d0
> > [<810d2060>] ? search_binary_handler+0x30/0x1d0
> > [<810d242f>] do_execve_common+0x22f/0x2a0
> > [<810d24b2>] do_execve+0x12/0x20
> > [<81009592>] sys_execve+0x32/0x70
> > [<81af7752>] ptregs_execve+0x12/0x20
> > [<81af76d4>] ? sysenter_do_call+0x12/0x36
> > 
> > Li Zefan noted that this is due to set_task_comm() dropping the task
> > lock before invoking perf_event_comm(), which could in fact result in
> > the task being freed up before perf_event_comm() completed tracing in
> > the case where one task invokes set_task_comm() on another task -- which
> > actually does occur via comm_write(), which can be invoked via /proc.
> > 
> 
> This is not true. The caller should ensure @tsk is valid during
> set_task_comm().
> 
> The warning comes from perf_cgroup_from_task(). We can trigger this warning
> in some other cases where perf cgroup is used, for example:

I must defer to your greater knowledge of this situation.  What patch
would you propose?

							Thanx, Paul

> # mount -t cgroup -o perf_event xxx /mnt
> # ./perf record -a -e 'sched:*' -G / true
> 
> [  171.603171] ===============================
> [  171.603173] [ INFO: suspicious RCU usage. ]
> [  171.603175] -------------------------------
> [  171.603178] include/linux/cgroup.h:548 suspicious rcu_dereference_check() usage!
> [  171.603180] 
> [  171.603181] other info that might help us debug this:
> [  171.603182] 
> [  171.603184] 
> [  171.603185] rcu_scheduler_active = 1, debug_locks = 0
> [  171.603188] 2 locks held by perf/2899:
> [  171.603190]  #0:  (&cpuctx_mutex){+.+...}, at: [<c04b2fe7>] sys_perf_event_open+0x4ed/0x62a
> [  171.603201]  #1:  (&cpuctx_lock){......}, at: [<c04ac4bc>] perf_ctx_lock+0xe/0x1d
> [  171.603210] 
> [  171.603211] stack backtrace:
> [  171.603214] Pid: 2899, comm: perf Not tainted 3.1.0+ #12
> [  171.603216] Call Trace:
> [  171.603222]  [<c07e7234>] ? printk+0x25/0x29
> [  171.603227]  [<c046279d>] lockdep_rcu_suspicious+0x90/0x9b
> [  171.603232]  [<c04ac688>] perf_cgroup_from_task+0x5e/0x64
> [  171.603236]  [<c04adfe7>] update_cgrp_time_from_event.clone.18+0x16/0x25
> [  171.603240]  [<c04b01a1>] __perf_install_in_context+0xa0/0xcf
> [  171.603244]  [<c04ac355>] ? pmu_dev_release+0xa/0xa
> [  171.603248]  [<c04ac386>] remote_function+0x31/0x37
> [  171.603253]  [<c0468aaa>] smp_call_function_single+0x7d/0xf5
> [  171.603257]  [<c04ac41d>] cpu_function_call+0x29/0x2e
> [  171.603261]  [<c04b0101>] ? perf_pm_suspend_cpu+0x9f/0x9f
> [  171.603264]  [<c04ae85b>] perf_install_in_context+0x53/0x9f
> [  171.603268]  [<c04b3033>] sys_perf_event_open+0x539/0x62a
> [  171.603273]  [<c04566f5>] ? up_read+0x1b/0x2e
> [  171.603277]  [<c07ec856>] ? do_page_fault+0x2e6/0x314
> [  171.603283]  [<c07ef2df>] sysenter_do_call+0x12/0x38
> 
> > This commit fixes this problem by entering an RCU read-side critical
> > section before acquiring the task lock and exiting this critical section
> > after perf_event_comm() returns.
> > 
> > Reported-by: Ingo Molnar <mingo@elte.hu>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > diff --git a/fs/exec.c b/fs/exec.c
> > index 25dcbe5..fb928d3 100644
> > --- a/fs/exec.c
> > +++ b/fs/exec.c
> > @@ -1056,6 +1056,7 @@ EXPORT_SYMBOL_GPL(get_task_comm);
> >  
> >  void set_task_comm(struct task_struct *tsk, char *buf)
> >  {
> > +	rcu_read_lock(); /* protect task pointer through tracing. */
> >  	task_lock(tsk);
> >  
> >  	/*
> > @@ -1069,6 +1070,7 @@ void set_task_comm(struct task_struct *tsk, char *buf)
> >  	strlcpy(tsk->comm, buf, sizeof(tsk->comm));
> >  	task_unlock(tsk);
> >  	perf_event_comm(tsk);
> > +	rcu_read_unlock();
> >  }
> >  
> >  int flush_old_exec(struct linux_binprm * bprm)
> > 
> 


^ permalink raw reply

* Re: How best replace /etc/init.d files with debugging versions right before jffs2 file is generated?
From: Paul Eggleton @ 2011-10-31  9:27 UTC (permalink / raw)
  To: Ulf Samuelsson; +Cc: openembedded-devel
In-Reply-To: <4EAC051D.2090708@telia.com>

On Saturday 29 October 2011 14:52:29 Ulf Samuelsson wrote:
> Having some problems booting a rootfs generated by openembedded,
> 
> "hwclock can't find /dev/misc/rtc"
> 
> and I would like to emit some debug  information by replacing some files
> in the /etc/init.d directory before the rootfs is finalized.
> 
> If I try to "install" from another package, I will get a conflict.
> 
> I guess I could loop mount the file system and then copy.
> Any other suggestions?

Perhaps you could do this by appending to ROOTFS_POSTPROCESS_COMMAND within 
the image recipe?

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



^ permalink raw reply

* Re: [PATCH RFC v2 01/13] libxl: Make libxl__xs_* more const-correct
From: Ian Campbell @ 2011-10-31  9:34 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <1319827031-15395-2-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2011-10-28 at 19:36 +0100, Ian Jackson wrote:
> Paths and values which are not modified by these functions should be
> declared as "const char *" not "char *".
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Obviously correct, (assuming it compiles, which is a safe assumption I
think ;-))):

Acked-by: Ian Campbell <ian.campbell@citrix.com>


> ---
>  tools/libxl/libxl_internal.h |    9 +++++----
>  tools/libxl/libxl_xshelp.c   |    9 +++++----
>  2 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 2e26ac6..31adbc8 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -181,18 +181,19 @@ _hidden char *libxl__dirname(libxl__gc *gc, const char *s);
>  _hidden char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, int length);
>  
>  _hidden int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
> -                    char *dir, char **kvs);
> +                             const char *dir, char **kvs);
>  _hidden int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
> -                   char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
> +               const char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
>     /* Each fn returns 0 on success.
>      * On error: returns -1, sets errno (no logging) */
>  
>  _hidden char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid);
>     /* On error: logs, returns NULL, sets errno. */
>  
> -_hidden char *libxl__xs_read(libxl__gc *gc, xs_transaction_t t, char *path);
> +_hidden char *libxl__xs_read(libxl__gc *gc, xs_transaction_t t,
> +                             const char *path);
>  _hidden char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
> -                                   char *path, unsigned int *nb);
> +                                   const char *path, unsigned int *nb);
>     /* On error: returns NULL, sets errno (no logging) */
>  
>  /* from xl_dom */
> diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
> index e41f962..56a7c7b 100644
> --- a/tools/libxl/libxl_xshelp.c
> +++ b/tools/libxl/libxl_xshelp.c
> @@ -49,7 +49,7 @@ char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, int length)
>  }
>  
>  int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
> -                    char *dir, char *kvs[])
> +                     const char *dir, char *kvs[])
>  {
>      libxl_ctx *ctx = libxl__gc_owner(gc);
>      char *path;
> @@ -69,7 +69,7 @@ int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
>  }
>  
>  int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
> -                   char *path, const char *fmt, ...)
> +                    const char *path, const char *fmt, ...)
>  {
>      libxl_ctx *ctx = libxl__gc_owner(gc);
>      char *s;
> @@ -87,7 +87,7 @@ int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
>      return 0;
>  }
>  
> -char * libxl__xs_read(libxl__gc *gc, xs_transaction_t t, char *path)
> +char * libxl__xs_read(libxl__gc *gc, xs_transaction_t t, const char *path)
>  {
>      libxl_ctx *ctx = libxl__gc_owner(gc);
>      char *ptr;
> @@ -113,7 +113,8 @@ char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid)
>      return s;
>  }
>  
> -char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t, char *path, unsigned int *nb)
> +char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t,
> +                           const char *path, unsigned int *nb)
>  {
>      libxl_ctx *ctx = libxl__gc_owner(gc);
>      char **ret = NULL;

^ permalink raw reply

* [U-Boot] [PATCH] Reintroduce MACH_TYPE_KM_KIRKWOOD for keymile ARM boards
From: Valentin Longchamp @ 2011-10-31  9:35 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <4EAE5A5A.9080201@compulab.co.il>

Hi Igor,

On 10/31/2011 09:20 AM, Igor Grinberg wrote:
> Hi Valentin,
> 
> On 10/31/11 10:06, Valentin Longchamp wrote:
>> We got dropped from Linux mach-types.h because of a lack of mainline
>> support and this is needed since the last Linux/u-boot mach-types
>> synchro.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> ---
>>  include/configs/km/km_arm.h |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
>> index c117943..eaf6017 100644
>> --- a/include/configs/km/km_arm.h
>> +++ b/include/configs/km/km_arm.h
>> @@ -36,6 +36,9 @@
>>  #ifndef _CONFIG_KM_ARM_H
>>  #define _CONFIG_KM_ARM_H
>>  
>> +/* We got removed from Linux mach-types.h */
>> +#define MACH_TYPE_KM_KIRKWOOD          2255
> 
> While you are at it, probably, it is a good time
> to switch to the new standard and use the CONFIG_MACH_TYPE
> option. Please, read the README file.
> 

Good Hint, I will send a further patch for this.

Thanks

-- 
Valentin Longchamp
Embedded Software Engineer
Hardware and Chip Integration
______________________________________
KEYMILE AG
Schwarzenburgstr. 73
CH-3097 Liebefeld
Phone +41 31 377 1318
Fax   +41 31 377 1212
valentin.longchamp at keymile.com
www.keymile.com
______________________________________
KEYMILE: A Specialist as a Partner

^ permalink raw reply

* [U-Boot] OMAP3 NAND ECC bug report
From: Arno Steffen @ 2011-10-31  9:36 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <4EAAD2F1.2060101@freescale.com>

Sure, Scott, not blame on you. Just frustating, doing bughunting for
issues that have been fixed long time ago. I would expect a bit more
from TI in this case. My fault obviously.
Ok, finally I got it, that's what matters.
- Arno


2011/10/28 Scott Wood <scottwood@freescale.com>:
> On 10/28/2011 01:10 AM, Arno Steffen wrote:
>> I have been used u-boot supportet (or better say not suppported) by TI
>> in their latest PSP/SDK (Juli 2011).
>> Base is 2010.06. But this issue was also inside older versions.
>
> It's not older versions I'm concerned about, but newer ones. ?This bug
> has been fixed in mainline U-Boot, about a year ago. ?We don't have a
> time machine to put the bug fix in older versions. :-)
>
> -Scott
>
>

^ permalink raw reply

* Re: [PATCH] wl12xx: set scan probe requests rate according to the no_cck flag
From: Luciano Coelho @ 2011-10-31  9:36 UTC (permalink / raw)
  To: guy; +Cc: linux-wireless, eliad
In-Reply-To: <CAB3XZEdk2pxH4k4tYXn44Sdb8STdXEh7VVsE85__e=M2Fk9s7A@mail.gmail.com>

On Sun, 2011-10-16 at 12:58 +0200, Eliad Peller wrote: 
> hi Guy,
> 
> On Sat, Oct 15, 2011 at 10:23 PM, Guy Eilam <guy@wizery.com> wrote:
> > Set the TX rate of probe requests during scanning according to the
> > no_cck flag in the scan request struct.
> >
> > Signed-off-by: Guy Eilam <guy@wizery.com>
> > ---
> [...]
> 
> > @@ -243,7 +242,12 @@ void wl1271_scan_stm(struct wl1271 *wl)
> >
> >        case WL1271_SCAN_STATE_2GHZ_ACTIVE:
> >                band = IEEE80211_BAND_2GHZ;
> > -               rate = wl1271_tx_min_rate_get(wl, wl->bitrate_masks[band]);
> > +               if (wl->scan.req->no_cck)
> > +                       rate = wl1271_tx_min_rate_get(wl,
> > +                                                CONF_TX_RATE_MASK_BASIC_P2P);
> > +               else
> > +                       rate = wl1271_tx_min_rate_get(wl,
> > +                                                CONF_TX_RATE_MASK_BASIC);
> 
> on a second thought, this seems a bit wrong.
> i think we should consider the configured bitrate_masks when scanning.
> maybe just mask-out the cck rates?

Any follow up on this?

-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH RFC v2 02/13] libxenstore: Provide xs_check_watch
From: Ian Campbell @ 2011-10-31  9:39 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <1319827031-15395-3-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> +
> +out_false:
> +	if (nonblocking) {
> +		int e = errno;
> +		setnonblock(fd, 0);
> +		errno = e;
> +	}

Since setnonblock cannot itself return an error should it always
preserve errno on behalf of the caller?

Ian.

^ permalink raw reply

* Re: Re: HT (Hyper Threading) aware process scheduling doesn't work as it should
From: Artem S. Tashkinov @ 2011-10-31  9:40 UTC (permalink / raw)
  To: hmh; +Cc: linux-kernel
In-Reply-To: <20111031091607.GB7106@khazad-dum.debian.net>

> On Oct 31, 2011, Henrique de Moraes Holschuh  wrote: 
> 
> On Sun, 30 Oct 2011, Artem S. Tashkinov wrote:
> > > Please make sure both are set to 0.  If they were not 0 at the time you
> > > ran your tests, please retest and report back.
> > 
> > That's 0 & 0 for me.
> 
> How idle is your system during the test?

load average: 0.00, 0.00, 0.00

As I've mentioned great many times I run this test on a completely idle system
(i.e. I even `init 3` in advance to avoid any unexpected CPU usage spikes
caused by unrelated processed).

I have to insist that people conduct this test on their own without trusting my
words. Probably there's something I overlook or don't fully understand but from
what I see, there's a serious issue here (at least Microsoft XP and 7 work exactly
the way I believe an OS should handle such a load).

Artem

^ permalink raw reply

* Re: [Xen-users] Re: Xen document day (Oct 12 or 26)
From: Fajar A. Nugraha @ 2011-10-31  9:40 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Florian Heigl, xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk, Andrew Bobulsky, Lars Kurth,
	Joseph Glanville, xen-users@lists.xensource.com
In-Reply-To: <1320053473.23193.15.camel@zakaz.uk.xensource.com>

On Mon, Oct 31, 2011 at 4:31 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Sun, 2011-10-30 at 20:58 +0000, Florian Heigl wrote:
>> - most of the pages being immutable so you couldn't even fix stuff.
>
> This one is a protective measure against spammers (which have been a big
> problem in the past). I sure hope media wiki has some better mechanisms
> than requiring every account to be manually authorised as an editor (I'm
> sure it must do!). It's a big barrier to "drive by fixups" as well as
> presenting an initial barrier which even longer term contributors have
> to cross.

For comparison purposes, the approach taken by wiki.freeradius.org
looks good: http://wiki.freeradius.org/New%20Wiki

It uses Github, Facebook, or Twitter account for login, trusting those
providers to filter-out spammers to a certain degree.

-- 
Fajar

^ permalink raw reply

* Re: [PATCH] parisc: futex: Use same lock set as lws calls
From: Domenico Andreoli @ 2011-10-31  9:41 UTC (permalink / raw)
  To: John David Anglin
  Cc: Carlos O'Donell, Rolf Eike Beer, linux-parisc, debian-hppa
In-Reply-To: <BLU0-SMTP39F6756368C783FB821D4297D60@phx.gbl>

On Sun, Oct 30, 2011 at 09:36:05PM -0400, John David Anglin wrote:
> 
> I integrated Guy's patch into debian 2.13-10 today and I was going to do
> a build, but then I discovered it builds using 4.4.  So, I patched
> 4.4 with the
> above change, and will rebuild 2.13 when it's done.  Hopefully, this
> will
> fix the udev bug which is blocking many python builds.  I'm
> interested to
> see if the glibc testsuite results will be better.

I would like to redo the exercise on my j5600, are you building Debian
packages? Could you please share the sources? Thank you.

Regards,
Domenico

^ permalink raw reply

* [PATCH 1/5] ext4: add data structure and functions for io statistic
From: Zheng Liu @ 2011-10-31  9:43 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel; +Cc: Wang Shaoyan
In-Reply-To: <1320054184-14329-1-git-send-email-wenqing.lz@taobao.com>

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

This patch adds two data structures and related functions for
counting different io types. The per-cpu counters are added for ios which
are issued to the disk.

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 fs/ext4/ext4.h     |   43 ++++++++++++++++++++++++++++
 fs/ext4/super.c    |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/fs.h |    8 +++++
 3 files changed, 131 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b7d7bd0..b0c51da 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1080,6 +1080,31 @@ struct ext4_super_block {
 #define EXT4_MF_FS_ABORTED	0x0002	/* Fatal error detected */
 
 /*
+ * ext4 io statistics flags
+ */
+enum {
+	EXT4_IOS_SUPER_BLOCK = 0,
+	EXT4_IOS_GROUP_DESC,
+	EXT4_IOS_INODE_BITMAP,
+	EXT4_IOS_BLOCK_BITMAP,
+	EXT4_IOS_INODE_TABLE,
+	EXT4_IOS_EXTENT_BLOCK,
+	EXT4_IOS_INDIRECT_BLOCK,
+	EXT4_IOS_DIR_ENTRY,
+	EXT4_IOS_EXTENDED_ATTR,
+	EXT4_IOS_REGULAR_DATA,
+	EXT4_IOS_TYPE_END,
+};
+
+struct ext4_ios {
+	const char *function;
+	unsigned int line;
+	int rw;
+	int flag;
+	int count;
+};
+
+/*
  * fourth extended-fs super-block data in memory
  */
 struct ext4_sb_info {
@@ -1248,6 +1273,11 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 		 ino <= le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count));
 }
 
+static inline unsigned ext4_blocks_per_page(struct inode *inode)
+{
+	return PAGE_CACHE_SIZE >> inode->i_blkbits;
+}
+
 /*
  * Inode dynamic state flags
  */
@@ -1875,6 +1905,19 @@ extern int ext4_group_extend(struct super_block *sb,
 				ext4_fsblk_t n_blocks_count);
 
 /* super.c */
+extern void __ext4_io_stat(const char *, unsigned int, int, int, unsigned long);
+extern void ext4_io_stat_read(void *ios);
+extern void ext4_io_stat_write(handle_t *, struct buffer_head *,
+			       const char *, unsigned int,
+			       int, unsigned long);
+extern void __ext4_init_ios(struct ios *ios, struct ext4_ios *ext4_ios,
+			    const char *function, unsigned int line,
+			    int rw, int flag, unsigned long count,
+			    void (*io_stat)(void *));
+#define ext4_init_ios(ios, ext4_ios, flag) \
+	__ext4_init_ios(ios, ext4_ios, __func__, __LINE__, \
+			READ, flag, 1, ext4_io_stat_read)
+
 extern void *ext4_kvmalloc(size_t size, gfp_t flags);
 extern void *ext4_kvzalloc(size_t size, gfp_t flags);
 extern void ext4_kvfree(void *ptr);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 44d0c8d..684f98a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4851,6 +4851,86 @@ out:
 
 #endif
 
+#define EXT4_IOS_DEBUG
+
+#ifdef EXT4_IOS_DEBUG
+#define ext4_ios_debug(f, a...) trace_printk(f, ##a)
+#else
+#define ext4_ios_debug(f, a...)
+#endif
+
+static DEFINE_PER_CPU(unsigned long [EXT4_IOS_TYPE_END][2], ext4_ios_counters);
+
+void ext4_io_stat_write(handle_t *handle, struct buffer_head *bh,
+			const char *function, unsigned int line,
+			int flag, unsigned long count)
+{
+	if (!bh)
+		goto write;
+
+	if (!handle || !ext4_handle_valid(handle)) {
+		if (buffer_dirty(bh))
+			return;
+	} else {
+		if (buffer_jbddirty(bh))
+			return;
+	}
+write:
+	__ext4_io_stat(function, line, WRITE, flag, count);
+}
+
+static inline unsigned long ext4_get_ios_counter(int rw, int flag)
+{
+	unsigned long sum = 0;
+	int i;
+
+	for_each_possible_cpu(i)
+		sum += per_cpu(ext4_ios_counters[flag][rw], i);
+
+	return sum;
+}
+
+void __ext4_io_stat(const char *function, unsigned int line,
+		    int rw, int flag, unsigned long count)
+{
+	const char *rwstr = rw ? "write" : "read";
+	const char *typestr[EXT4_IOS_TYPE_END] = {
+		"super block", "group descriptor",
+		"inode bitmap", "block bitmap",
+		"inode table", "extent block",
+		"indirect block", "dir entry",
+		"extended attributes", "regular data"
+	};
+
+	BUG_ON(flag < 0 || flag >= EXT4_IOS_TYPE_END);
+	this_cpu_add(ext4_ios_counters[flag][rw], count);
+
+	ext4_ios_debug("%s:%d - %s %s - %ld block" " - total %s %ld block\n",
+		       function, line, rwstr, typestr[flag], count, rwstr,
+		       ext4_get_ios_counter(rw, flag));
+}
+
+void ext4_io_stat_read(void *data)
+{
+	struct ext4_ios *ext4_ios = data;
+	return __ext4_io_stat(ext4_ios->function, ext4_ios->line,
+			      ext4_ios->rw, ext4_ios->flag, ext4_ios->count);
+}
+
+void __ext4_init_ios(struct ios *ios, struct ext4_ios *ext4_ios,
+		     const char *function, unsigned int line,
+		     int rw, int flag, unsigned long count,
+		     void (*io_stat)(void *))
+{
+	ext4_ios->function = function;
+	ext4_ios->line = line;
+	ext4_ios->rw = rw;
+	ext4_ios->flag = flag;
+	ext4_ios->count = count;
+	ios->data = ext4_ios;
+	ios->io_stat = io_stat;
+}
+
 static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
 		       const char *dev_name, void *data)
 {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 14493a2..49b3c24 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2676,5 +2676,13 @@ static inline void inode_has_no_xattr(struct inode *inode)
 		inode->i_flags |= S_NOSEC;
 }
 
+/*
+ * IO statistics
+ */
+struct ios {
+	void *data;
+	void (*io_stat)(void *data);
+};
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 2/5] ext4: add hooks in buffer layer
From: Zheng Liu @ 2011-10-31  9:43 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel; +Cc: Wang Shaoyan
In-Reply-To: <1320054184-14329-1-git-send-email-wenqing.lz@taobao.com>

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

Add hooks in buffer layer, we just ignore the IO which hit in cache.
Some interfaces are changed to pass ios argument.

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 fs/buffer.c                 |   61 ++++++++++++++++++++++++++++++++++++------
 include/linux/buffer_head.h |   17 ++++++++++++
 2 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 936d603..1e12533 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1208,7 +1208,8 @@ void __bforget(struct buffer_head *bh)
 }
 EXPORT_SYMBOL(__bforget);
 
-static struct buffer_head *__bread_slow(struct buffer_head *bh)
+static struct buffer_head *__bread_slow_stat(struct buffer_head *bh,
+					     struct ios *ios)
 {
 	lock_buffer(bh);
 	if (buffer_uptodate(bh)) {
@@ -1219,13 +1220,21 @@ static struct buffer_head *__bread_slow(struct buffer_head *bh)
 		bh->b_end_io = end_buffer_read_sync;
 		submit_bh(READ, bh);
 		wait_on_buffer(bh);
-		if (buffer_uptodate(bh))
+		if (buffer_uptodate(bh)) {
+			if (ios)
+				ios->io_stat(ios->data);
 			return bh;
+		}
 	}
 	brelse(bh);
 	return NULL;
 }
 
+static struct buffer_head *__bread_slow(struct buffer_head *bh)
+{
+	return __bread_slow_stat(bh, NULL);
+}
+
 /*
  * Per-cpu buffer LRU implementation.  To reduce the cost of __find_get_block().
  * The bhs[] array is sorted - newest buffer is at bhs[0].  Buffers have their
@@ -1387,13 +1396,20 @@ EXPORT_SYMBOL(__getblk);
  */
 void __breadahead(struct block_device *bdev, sector_t block, unsigned size)
 {
+	__breadahead_stat(bdev, block, size, NULL);
+}
+EXPORT_SYMBOL(__breadahead);
+
+void __breadahead_stat(struct block_device *bdev, sector_t block,
+		       unsigned size, struct ios *ios)
+{
 	struct buffer_head *bh = __getblk(bdev, block, size);
 	if (likely(bh)) {
-		ll_rw_block(READA, 1, &bh);
+		ll_rw_block_stat(READA, 1, &bh, ios);
 		brelse(bh);
 	}
 }
-EXPORT_SYMBOL(__breadahead);
+EXPORT_SYMBOL(__breadahead_stat);
 
 /**
  *  __bread() - reads a specified block and returns the bh
@@ -1407,13 +1423,21 @@ EXPORT_SYMBOL(__breadahead);
 struct buffer_head *
 __bread(struct block_device *bdev, sector_t block, unsigned size)
 {
+	return __bread_stat(bdev, block, size, NULL);
+}
+EXPORT_SYMBOL(__bread);
+
+struct buffer_head *
+__bread_stat(struct block_device *bdev, sector_t block, unsigned size,
+	     struct ios *ios)
+{
 	struct buffer_head *bh = __getblk(bdev, block, size);
 
 	if (likely(bh) && !buffer_uptodate(bh))
-		bh = __bread_slow(bh);
+		bh = __bread_slow_stat(bh, ios);
 	return bh;
 }
-EXPORT_SYMBOL(__bread);
+EXPORT_SYMBOL(__bread_stat);
 
 /*
  * invalidate_bh_lrus() is called rarely - but not only at unmount.
@@ -2978,7 +3002,8 @@ EXPORT_SYMBOL(submit_bh);
  * All of the buffers must be for the same device, and must also be a
  * multiple of the current approved size for the device.
  */
-void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
+void ll_rw_block_stat(int rw, int nr, struct buffer_head *bhs[],
+		      struct ios *ios)
 {
 	int i;
 
@@ -2992,6 +3017,8 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
 				bh->b_end_io = end_buffer_write_sync;
 				get_bh(bh);
 				submit_bh(WRITE, bh);
+				if (ios)
+					ios->io_stat(ios->data);
 				continue;
 			}
 		} else {
@@ -2999,12 +3026,19 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
 				bh->b_end_io = end_buffer_read_sync;
 				get_bh(bh);
 				submit_bh(rw, bh);
+				if (ios)
+					ios->io_stat(ios->data);
 				continue;
 			}
 		}
 		unlock_buffer(bh);
 	}
 }
+EXPORT_SYMBOL(ll_rw_block_stat);
+void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
+{
+	ll_rw_block_stat(rw, nr, bhs, NULL);
+}
 EXPORT_SYMBOL(ll_rw_block);
 
 void write_dirty_buffer(struct buffer_head *bh, int rw)
@@ -3288,6 +3322,12 @@ EXPORT_SYMBOL(bh_uptodate_or_lock);
  */
 int bh_submit_read(struct buffer_head *bh)
 {
+	return bh_submit_read_stat(bh, NULL);
+}
+EXPORT_SYMBOL(bh_submit_read);
+
+int bh_submit_read_stat(struct buffer_head *bh, struct ios *ios)
+{
 	BUG_ON(!buffer_locked(bh));
 
 	if (buffer_uptodate(bh)) {
@@ -3299,11 +3339,14 @@ int bh_submit_read(struct buffer_head *bh)
 	bh->b_end_io = end_buffer_read_sync;
 	submit_bh(READ, bh);
 	wait_on_buffer(bh);
-	if (buffer_uptodate(bh))
+	if (buffer_uptodate(bh)) {
+		if (ios)
+			ios->io_stat(ios->data);
 		return 0;
+	}
 	return -EIO;
 }
-EXPORT_SYMBOL(bh_submit_read);
+EXPORT_SYMBOL(bh_submit_read_stat);
 
 void __init buffer_init(void)
 {
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 458f497..07306a9 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -171,13 +171,18 @@ struct buffer_head *__getblk(struct block_device *bdev, sector_t block,
 void __brelse(struct buffer_head *);
 void __bforget(struct buffer_head *);
 void __breadahead(struct block_device *, sector_t block, unsigned int size);
+void __breadahead_stat(struct block_device *, sector_t block,
+		       unsigned int size, struct ios *ios);
 struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size);
+struct buffer_head *__bread_stat(struct block_device *, sector_t block,
+				 unsigned size, struct ios *ios);
 void invalidate_bh_lrus(void);
 struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
 void free_buffer_head(struct buffer_head * bh);
 void unlock_buffer(struct buffer_head *bh);
 void __lock_buffer(struct buffer_head *bh);
 void ll_rw_block(int, int, struct buffer_head * bh[]);
+void ll_rw_block_stat(int, int, struct buffer_head *bh[], struct ios *ios);
 int sync_dirty_buffer(struct buffer_head *bh);
 int __sync_dirty_buffer(struct buffer_head *bh, int rw);
 void write_dirty_buffer(struct buffer_head *bh, int rw);
@@ -186,6 +191,7 @@ void write_boundary_block(struct block_device *bdev,
 			sector_t bblock, unsigned blocksize);
 int bh_uptodate_or_lock(struct buffer_head *bh);
 int bh_submit_read(struct buffer_head *bh);
+int bh_submit_read_stat(struct buffer_head *bh, struct ios *ios);
 
 extern int buffer_heads_over_limit;
 
@@ -288,12 +294,23 @@ sb_bread(struct super_block *sb, sector_t block)
 {
 	return __bread(sb->s_bdev, block, sb->s_blocksize);
 }
+static inline struct buffer_head *
+sb_bread_stat(struct super_block *sb, sector_t block, struct ios *ios)
+{
+	return __bread_stat(sb->s_bdev, block, sb->s_blocksize, ios);
+}
+
 
 static inline void
 sb_breadahead(struct super_block *sb, sector_t block)
 {
 	__breadahead(sb->s_bdev, block, sb->s_blocksize);
 }
+static inline void
+sb_breadahead_stat(struct super_block *sb, sector_t block, struct ios *ios)
+{
+	__breadahead_stat(sb->s_bdev, block, sb->s_blocksize, ios);
+}
 
 static inline struct buffer_head *
 sb_getblk(struct super_block *sb, sector_t block)
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 3/5] ext4: io stat read related entrance
From: Zheng Liu @ 2011-10-31  9:43 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel; +Cc: Wang Shaoyan
In-Reply-To: <1320054184-14329-1-git-send-email-wenqing.lz@taobao.com>

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

Add read related statistic code at these read functions

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 fs/ext4/balloc.c   |    5 ++++-
 fs/ext4/dir.c      |    6 ++++++
 fs/ext4/extents.c  |   13 ++++++++++---
 fs/ext4/ialloc.c   |    5 ++++-
 fs/ext4/indirect.c |   11 +++++++++--
 fs/ext4/inode.c    |   25 +++++++++++++++++++++----
 fs/ext4/mballoc.c  |    2 ++
 fs/ext4/namei.c    |   12 +++++++++---
 fs/ext4/super.c    |   12 +++++++++---
 fs/ext4/xattr.c    |   30 +++++++++++++++++++++++++-----
 10 files changed, 99 insertions(+), 22 deletions(-)

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index f8224ad..b841c26 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -298,6 +298,8 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
 	struct ext4_group_desc *desc;
 	struct buffer_head *bh = NULL;
 	ext4_fsblk_t bitmap_blk;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	desc = ext4_get_group_desc(sb, block_group, NULL);
 	if (!desc)
@@ -346,7 +348,8 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
 	 */
 	trace_ext4_read_block_bitmap_load(sb, block_group);
 	set_bitmap_uptodate(bh);
-	if (bh_submit_read(bh) < 0) {
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_BLOCK_BITMAP);
+	if (bh_submit_read_stat(bh, &ios) < 0) {
 		put_bh(bh);
 		ext4_error(sb, "Cannot read block bitmap - "
 			    "block_group = %u, block_bitmap = %llu",
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 164c560..35d9f17 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -153,6 +153,12 @@ static int ext4_readdir(struct file *filp,
 			pgoff_t index = map.m_pblk >>
 					(PAGE_CACHE_SHIFT - inode->i_blkbits);
 			if (!ra_has_index(&filp->f_ra, index))
+				/*
+				 * If in EXT4_INODE_INDEX mode, we reach here
+				 * because all dir entry are in one block, so
+				 * read ahead is nouse, we just statistic as
+				 * one block
+				 */
 				page_cache_sync_readahead(
 					sb->s_bdev->bd_inode->i_mapping,
 					&filp->f_ra, filp,
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 57cf568..81f5b3f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -673,9 +673,12 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
 		if (unlikely(!bh))
 			goto err;
 		if (!bh_uptodate_or_lock(bh)) {
+			struct ios ios;
+			struct ext4_ios ext4_ios;
 			trace_ext4_ext_load_extent(inode, block,
 						path[ppos].p_block);
-			if (bh_submit_read(bh) < 0) {
+			ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENT_BLOCK);
+			if (bh_submit_read_stat(bh, &ios) < 0) {
 				put_bh(bh);
 				goto err;
 			}
@@ -1275,6 +1278,8 @@ static int ext4_ext_search_right(struct inode *inode,
 	ext4_fsblk_t block;
 	int depth;	/* Note, NOT eh_depth; depth from top of tree */
 	int ee_len;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	if (unlikely(path == NULL)) {
 		EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical);
@@ -1345,7 +1350,8 @@ got_index:
 	ix++;
 	block = ext4_idx_pblock(ix);
 	while (++depth < path->p_depth) {
-		bh = sb_bread(inode->i_sb, block);
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENT_BLOCK);
+		bh = sb_bread_stat(inode->i_sb, block, &ios);
 		if (bh == NULL)
 			return -EIO;
 		eh = ext_block_hdr(bh);
@@ -1359,7 +1365,8 @@ got_index:
 		put_bh(bh);
 	}
 
-	bh = sb_bread(inode->i_sb, block);
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENT_BLOCK);
+	bh = sb_bread_stat(inode->i_sb, block, &ios);
 	if (bh == NULL)
 		return -EIO;
 	eh = ext_block_hdr(bh);
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 9c63f27..68b3295 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -104,6 +104,8 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
 	struct ext4_group_desc *desc;
 	struct buffer_head *bh = NULL;
 	ext4_fsblk_t bitmap_blk;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	desc = ext4_get_group_desc(sb, block_group, NULL);
 	if (!desc)
@@ -154,7 +156,8 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
 	 */
 	trace_ext4_load_inode_bitmap(sb, block_group);
 	set_bitmap_uptodate(bh);
-	if (bh_submit_read(bh) < 0) {
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_INODE_BITMAP);
+	if (bh_submit_read_stat(bh, &ios) < 0) {
 		put_bh(bh);
 		ext4_error(sb, "Cannot read inode bitmap - "
 			    "block_group = %u, inode_bitmap = %llu",
diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
index 0962642..0f61f2f 100644
--- a/fs/ext4/indirect.c
+++ b/fs/ext4/indirect.c
@@ -158,7 +158,10 @@ static Indirect *ext4_get_branch(struct inode *inode, int depth,
 			goto failure;
 
 		if (!bh_uptodate_or_lock(bh)) {
-			if (bh_submit_read(bh) < 0) {
+			struct ios ios;
+			struct ext4_ios ext4_ios;
+			ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_INDIRECT_BLOCK);
+			if (bh_submit_read_stat(bh, &ios) < 0) {
 				put_bh(bh);
 				goto failure;
 			}
@@ -1233,6 +1236,9 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
 		int addr_per_block = EXT4_ADDR_PER_BLOCK(inode->i_sb);
 		p = last;
 		while (--p >= first) {
+			struct ios ios;
+			struct ext4_ios ext4_ios;
+
 			nr = le32_to_cpu(*p);
 			if (!nr)
 				continue;		/* A hole */
@@ -1247,7 +1253,8 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
 			}
 
 			/* Go read the buffer for the next level down */
-			bh = sb_bread(inode->i_sb, nr);
+			ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_INDIRECT_BLOCK);
+			bh = sb_bread_stat(inode->i_sb, nr, &ios);
 
 			/*
 			 * A read failure? Report error and clear slot
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 986e238..3179252 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -641,13 +641,16 @@ struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
 			       ext4_lblk_t block, int create, int *err)
 {
 	struct buffer_head *bh;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	bh = ext4_getblk(handle, inode, block, create, err);
 	if (!bh)
 		return bh;
 	if (buffer_uptodate(bh))
 		return bh;
-	ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh);
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_DIR_ENTRY);
+	ll_rw_block_stat(READ | REQ_META | REQ_PRIO, 1, &bh, &ios);
 	wait_on_buffer(bh);
 	if (buffer_uptodate(bh))
 		return bh;
@@ -2529,6 +2532,8 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
 static int ext4_readpage(struct file *file, struct page *page)
 {
 	trace_ext4_readpage(page);
+	__ext4_io_stat(__func__, __LINE__, READ, EXT4_IOS_REGULAR_DATA,
+		       ext4_blocks_per_page(page->mapping->host));
 	return mpage_readpage(page, ext4_get_block);
 }
 
@@ -2536,6 +2541,8 @@ static int
 ext4_readpages(struct file *file, struct address_space *mapping,
 		struct list_head *pages, unsigned nr_pages)
 {
+	__ext4_io_stat(__func__, __LINE__, READ, EXT4_IOS_REGULAR_DATA,
+		       nr_pages * ext4_blocks_per_page(mapping->host));
 	return mpage_readpages(mapping, pages, nr_pages, ext4_get_block);
 }
 
@@ -3048,8 +3055,11 @@ int ext4_block_zero_page_range(handle_t *handle,
 		set_buffer_uptodate(bh);
 
 	if (!buffer_uptodate(bh)) {
+		struct ios ios;
+		struct ext4_ios ext4_ios;
 		err = -EIO;
-		ll_rw_block(READ, 1, &bh);
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_REGULAR_DATA);
+		ll_rw_block_stat(READ, 1, &bh, &ios);
 		wait_on_buffer(bh);
 		/* Uhhuh. Read error. Complain and punt. */
 		if (!buffer_uptodate(bh))
@@ -3286,8 +3296,13 @@ make_io:
 			table += num / inodes_per_block;
 			if (end > table)
 				end = table;
-			while (b <= end)
-				sb_breadahead(sb, b++);
+			while (b <= end) {
+				struct ios ios;
+				struct ext4_ios ext4_ios;
+				ext4_init_ios(&ios, &ext4_ios,
+					      EXT4_IOS_INODE_TABLE);
+				sb_breadahead_stat(sb, b++, &ios);
+			}
 		}
 
 		/*
@@ -3306,6 +3321,8 @@ make_io:
 			brelse(bh);
 			return -EIO;
 		}
+		__ext4_io_stat(__func__, __LINE__, READ,
+			       EXT4_IOS_INODE_TABLE, 1);
 	}
 has_buffer:
 	iloc->bh = bh;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 17a5a57..d961d17 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -882,6 +882,8 @@ static int ext4_mb_init_cache(struct page *page, char *incore)
 		set_bitmap_uptodate(bh[i]);
 		bh[i]->b_end_io = end_buffer_read_sync;
 		submit_bh(READ, bh[i]);
+		__ext4_io_stat(__func__, __LINE__, READ,
+			       EXT4_IOS_BLOCK_BITMAP, 1);
 		mb_debug(1, "read bitmap for group %u\n", first_group + i);
 	}
 
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 1c924fa..ba3f5b8 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -921,9 +921,15 @@ restart:
 				num++;
 				bh = ext4_getblk(NULL, dir, b++, 0, &err);
 				bh_use[ra_max] = bh;
-				if (bh)
-					ll_rw_block(READ | REQ_META | REQ_PRIO,
-						    1, &bh);
+				if (bh) {
+					struct ios ios;
+					struct ext4_ios ext4_ios;
+					ext4_init_ios(&ios, &ext4_ios,
+						      EXT4_IOS_DIR_ENTRY);
+					ll_rw_block_stat(READ | REQ_META | \
+							 REQ_PRIO, 1,
+							 &bh, &ios);
+				}
 			}
 		}
 		if ((bh = bh_use[ra_ptr++]) == NULL)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 684f98a..49a5952 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3095,6 +3095,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	int err;
 	unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
 	ext4_group_t first_not_zeroed;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
@@ -3138,7 +3140,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		logical_sb_block = sb_block;
 	}
 
-	if (!(bh = sb_bread(sb, logical_sb_block))) {
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_SUPER_BLOCK);
+	bh = sb_bread_stat(sb, logical_sb_block, &ios);
+	if (!bh) {
 		ext4_msg(sb, KERN_ERR, "unable to read superblock");
 		goto out_fail;
 	}
@@ -3285,7 +3289,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		brelse(bh);
 		logical_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE;
 		offset = do_div(logical_sb_block, blocksize);
-		bh = sb_bread(sb, logical_sb_block);
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_SUPER_BLOCK);
+		bh = sb_bread_stat(sb, logical_sb_block, &ios);
 		if (!bh) {
 			ext4_msg(sb, KERN_ERR,
 			       "Can't read superblock on 2nd try");
@@ -3455,7 +3460,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 
 	for (i = 0; i < db_count; i++) {
 		block = descriptor_loc(sb, logical_sb_block, i);
-		sbi->s_group_desc[i] = sb_bread(sb, block);
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_GROUP_DESC);
+		sbi->s_group_desc[i] = sb_bread_stat(sb, block, &ios);
 		if (!sbi->s_group_desc[i]) {
 			ext4_msg(sb, KERN_ERR,
 			       "can't read group descriptor %d", i);
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index c757adc..cb7a9bb 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -213,6 +213,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
 	struct ext4_xattr_entry *entry;
 	size_t size;
 	int error;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	ea_idebug(inode, "name=%d.%s, buffer=%p, buffer_size=%ld",
 		  name_index, name, buffer, (long)buffer_size);
@@ -221,7 +223,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
 	if (!EXT4_I(inode)->i_file_acl)
 		goto cleanup;
 	ea_idebug(inode, "reading block %u", EXT4_I(inode)->i_file_acl);
-	bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+	bh = sb_bread_stat(inode->i_sb, EXT4_I(inode)->i_file_acl, &ios);
 	if (!bh)
 		goto cleanup;
 	ea_bdebug(bh, "b_count=%d, refcount=%d",
@@ -356,6 +359,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size)
 	struct inode *inode = dentry->d_inode;
 	struct buffer_head *bh = NULL;
 	int error;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	ea_idebug(inode, "buffer=%p, buffer_size=%ld",
 		  buffer, (long)buffer_size);
@@ -364,7 +369,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size)
 	if (!EXT4_I(inode)->i_file_acl)
 		goto cleanup;
 	ea_idebug(inode, "reading block %u", EXT4_I(inode)->i_file_acl);
-	bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+	bh = sb_bread_stat(inode->i_sb, EXT4_I(inode)->i_file_acl, &ios);
 	error = -EIO;
 	if (!bh)
 		goto cleanup;
@@ -655,7 +661,10 @@ ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i,
 
 	if (EXT4_I(inode)->i_file_acl) {
 		/* The inode already has an extended attribute block. */
-		bs->bh = sb_bread(sb, EXT4_I(inode)->i_file_acl);
+		struct ios ios;
+		struct ext4_ios ext4_ios;
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+		bs->bh = sb_bread_stat(sb, EXT4_I(inode)->i_file_acl, &ios);
 		error = -EIO;
 		if (!bs->bh)
 			goto cleanup;
@@ -1186,7 +1195,11 @@ retry:
 	 * EA block can hold new_extra_isize bytes.
 	 */
 	if (EXT4_I(inode)->i_file_acl) {
-		bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
+		struct ios ios;
+		struct ext4_ios ext4_ios;
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+		bh = sb_bread_stat(inode->i_sb, EXT4_I(inode)->i_file_acl,
+				   &ios);
 		error = -EIO;
 		if (!bh)
 			goto cleanup;
@@ -1364,10 +1377,14 @@ void
 ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
 {
 	struct buffer_head *bh = NULL;
+	struct ios ios;
+	struct ext4_ios ext4_ios;
 
 	if (!EXT4_I(inode)->i_file_acl)
 		goto cleanup;
 	bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
+	ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+	bh = sb_bread_stat(inode->i_sb, EXT4_I(inode)->i_file_acl, &ios);
 	if (!bh) {
 		EXT4_ERROR_INODE(inode, "block %llu read error",
 				 EXT4_I(inode)->i_file_acl);
@@ -1493,13 +1510,16 @@ again:
 				       hash);
 	while (ce) {
 		struct buffer_head *bh;
+		struct ios ios;
+		struct ext4_ios ext4_ios;
 
 		if (IS_ERR(ce)) {
 			if (PTR_ERR(ce) == -EAGAIN)
 				goto again;
 			break;
 		}
-		bh = sb_bread(inode->i_sb, ce->e_block);
+		ext4_init_ios(&ios, &ext4_ios, EXT4_IOS_EXTENDED_ATTR);
+		bh = sb_bread_stat(inode->i_sb, ce->e_block, &ios);
 		if (!bh) {
 			EXT4_ERROR_INODE(inode, "block %lu read error",
 					 (unsigned long) ce->e_block);
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 5/5] ext4: io stat show result in sysfs
From: Zheng Liu @ 2011-10-31  9:43 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel; +Cc: Wang Shaoyan
In-Reply-To: <1320054184-14329-1-git-send-email-wenqing.lz@taobao.com>

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

Show statistic results in sysfs

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 fs/ext4/super.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 93ec9a7..049d06c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2510,6 +2510,52 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a,
 	return count;
 }
 
+static inline unsigned long ext4_get_ios_counter(int rw, int flag);
+static ssize_t io_stats_show(struct ext4_attr *a,
+			     struct ext4_sb_info *sbi, char *buf)
+{
+	int i = 0;
+	unsigned long ios_counters[EXT4_IOS_TYPE_END][2] = {{0,},};
+
+	for (i = 0; i < EXT4_IOS_TYPE_END; i++) {
+		ios_counters[i][READ] = ext4_get_ios_counter(READ, i);
+		ios_counters[i][WRITE] = ext4_get_ios_counter(WRITE, i);
+	}
+
+	return snprintf(buf, PAGE_SIZE,
+			"TYPE                     READ    WRITE\n"
+			"super block        %8lu %8lu\n"
+			"group descriptor   %8lu %8lu\n"
+			"inode bitmap       %8lu %8lu\n"
+			"block bitmap       %8lu %8lu\n"
+			"inode table        %8lu %8lu\n"
+			"extent block       %8lu %8lu\n"
+			"indirect block     %8lu %8lu\n"
+			"dir entry          %8lu %8lu\n"
+			"extended attribute %8lu %8lu\n"
+			"regular data       %8lu %8lu\n",
+			ios_counters[EXT4_IOS_SUPER_BLOCK][READ],
+			ios_counters[EXT4_IOS_SUPER_BLOCK][WRITE],
+			ios_counters[EXT4_IOS_GROUP_DESC][READ],
+			ios_counters[EXT4_IOS_GROUP_DESC][WRITE],
+			ios_counters[EXT4_IOS_INODE_BITMAP][READ],
+			ios_counters[EXT4_IOS_INODE_BITMAP][WRITE],
+			ios_counters[EXT4_IOS_BLOCK_BITMAP][READ],
+			ios_counters[EXT4_IOS_BLOCK_BITMAP][WRITE],
+			ios_counters[EXT4_IOS_INODE_TABLE][READ],
+			ios_counters[EXT4_IOS_INODE_TABLE][WRITE],
+			ios_counters[EXT4_IOS_EXTENT_BLOCK][READ],
+			ios_counters[EXT4_IOS_EXTENT_BLOCK][WRITE],
+			ios_counters[EXT4_IOS_INDIRECT_BLOCK][READ],
+			ios_counters[EXT4_IOS_INDIRECT_BLOCK][WRITE],
+			ios_counters[EXT4_IOS_DIR_ENTRY][READ],
+			ios_counters[EXT4_IOS_DIR_ENTRY][WRITE],
+			ios_counters[EXT4_IOS_EXTENDED_ATTR][READ],
+			ios_counters[EXT4_IOS_EXTENDED_ATTR][WRITE],
+			ios_counters[EXT4_IOS_REGULAR_DATA][READ],
+			ios_counters[EXT4_IOS_REGULAR_DATA][WRITE]);
+}
+
 static ssize_t sbi_ui_show(struct ext4_attr *a,
 			   struct ext4_sb_info *sbi, char *buf)
 {
@@ -2553,6 +2599,7 @@ EXT4_RO_ATTR(session_write_kbytes);
 EXT4_RO_ATTR(lifetime_write_kbytes);
 EXT4_RO_ATTR(extent_cache_hits);
 EXT4_RO_ATTR(extent_cache_misses);
+EXT4_RO_ATTR(io_stats);
 EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, sbi_ui_show,
 		 inode_readahead_blks_store, s_inode_readahead_blks);
 EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal);
@@ -2579,6 +2626,7 @@ static struct attribute *ext4_attrs[] = {
 	ATTR_LIST(mb_stream_req),
 	ATTR_LIST(mb_group_prealloc),
 	ATTR_LIST(max_writeback_mb_bump),
+	ATTR_LIST(io_stats),
 	NULL,
 };
 
-- 
1.7.4.1


^ permalink raw reply related

* Re: [B.A.T.M.A.N.] [PATCH 0/6] DAT: Distributed ARP Table
From: Marek Lindner @ 2011-10-31  9:42 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking
In-Reply-To: <4EAE69CF.6020807@hundeboll.net>

On Monday, October 31, 2011 10:26:39 Martin Hundebøll wrote:
> On 2011-10-31 01:03, Simon Wunderlich wrote:
> > Hello Antonio,
> > 
> > thanks for the patchset! I've tested it again in my kvm setup, it worked
> > very well.
> > 
> > There are some issues remaining, I'll comment the individual patches for
> > this.
> > 
> > About the general stuff:
> >   * maybe we should rename arp.{c|h} to dat.{c|h} to avoid confusion with
> >   
> >     other code in the linux kernel?
> 
> I propose "distributet-arp-tables.{c|h}" to avoid too many acronyms in our
> file names.

I second that but I suggest:
distributed-arp-tables.{c|h}

Regards,
Marek


^ permalink raw reply

* [PATCH 0/5] ext4: statistic of different data and metadata IO types
From: Zheng Liu @ 2011-10-31  9:42 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel

Hi,

This patchset adds statistic of different data and metadata IO types.
Some hooks are added into filesystem's read and write routines and we
can see how much IOs are issued to the disk. Meanwhile we ignore the
IOs which hit in cache.

ios structure saves a callback function for counting read operations
because read counter need to be increased in buffer layer.

ext4_ios and related functions are defined to count how much different
types of IOs are issued to the disk in ext4.

Metadata and data types in ext4:
+--------------------------------+
| Metadata:                      |
|      super block               |
|      group desc                |
|      inode bitmap              |
|      block bitmap              |
|      inode table               |
|      extents                   |
|      indirect block            |
|      dir index and entry       |
|      extended attributes       |
+--------------------------------+
| Data:                          |
|      regular data block        |
+--------------------------------+

Wang Shaoyan (5):
	ext4: add data structure and functions for io statistic
	ext4: add hooks in buffer layer
	ext4: io stat read related entrance
	ext4: io stat write related entrance
	ext4: io stat show result in sysfs
-- 
1.7.4.1

^ permalink raw reply

* [PATCH 4/5] ext4: io stat write related entrance
From: Zheng Liu @ 2011-10-31  9:43 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel; +Cc: Wang Shaoyan
In-Reply-To: <1320054184-14329-1-git-send-email-wenqing.lz@taobao.com>

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

Add write related statistic code at these write functions

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 fs/ext4/extents.c  |    8 ++++++++
 fs/ext4/ialloc.c   |   14 ++++++++++++++
 fs/ext4/indirect.c |   15 +++++++++++++--
 fs/ext4/inode.c    |   14 ++++++++++++++
 fs/ext4/mballoc.c  |   14 ++++++++++++++
 fs/ext4/namei.c    |   26 ++++++++++++++++++++++++++
 fs/ext4/super.c    |    2 ++
 fs/ext4/xattr.c    |   13 ++++++++++++-
 8 files changed, 103 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 81f5b3f..6258bb2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -102,6 +102,8 @@ static int ext4_ext_dirty(handle_t *handle, struct inode *inode,
 	int err;
 	if (path->p_bh) {
 		/* path points to block */
+		ext4_io_stat_write(handle, path->p_bh, __func__, __LINE__,
+				   EXT4_IOS_EXTENT_BLOCK, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, path->p_bh);
 	} else {
 		/* path points to leaf/index in inode body */
@@ -912,6 +914,8 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 	set_buffer_uptodate(bh);
 	unlock_buffer(bh);
 
+	ext4_io_stat_write(handle, bh, __func__, __LINE__,
+			   EXT4_IOS_EXTENT_BLOCK, 1);
 	err = ext4_handle_dirty_metadata(handle, inode, bh);
 	if (err)
 		goto cleanup;
@@ -990,6 +994,8 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
 		set_buffer_uptodate(bh);
 		unlock_buffer(bh);
 
+		ext4_io_stat_write(handle, bh, __func__, __LINE__,
+				   EXT4_IOS_EXTENT_BLOCK, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, bh);
 		if (err)
 			goto cleanup;
@@ -1088,6 +1094,8 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
 	set_buffer_uptodate(bh);
 	unlock_buffer(bh);
 
+	ext4_io_stat_write(handle, bh, __func__, __LINE__,
+			   EXT4_IOS_EXTENT_BLOCK, 1);
 	err = ext4_handle_dirty_metadata(handle, inode, bh);
 	if (err)
 		goto out;
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 68b3295..3dd7c09 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -280,10 +280,14 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
 			atomic_dec(&sbi->s_flex_groups[f].used_dirs);
 	}
 	BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, bh2, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	fatal = ext4_handle_dirty_metadata(handle, NULL, bh2);
 out:
 	if (cleared) {
 		BUFFER_TRACE(bitmap_bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, bitmap_bh, __func__, __LINE__,
+				   EXT4_IOS_INODE_BITMAP, 1);
 		err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 		if (!fatal)
 			fatal = err;
@@ -909,6 +913,9 @@ repeat_in_this_group:
 				/* we won it */
 				BUFFER_TRACE(inode_bitmap_bh,
 					"call ext4_handle_dirty_metadata");
+				ext4_io_stat_write(handle, inode_bitmap_bh,
+						   __func__, __LINE__,
+						   EXT4_IOS_INODE_BITMAP, 1);
 				err = ext4_handle_dirty_metadata(handle,
 								 NULL,
 							inode_bitmap_bh);
@@ -968,6 +975,9 @@ got:
 		/* Don't need to dirty bitmap block if we didn't change it */
 		if (free) {
 			BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
+			ext4_io_stat_write(handle, block_bitmap_bh,
+					   __func__, __LINE__,
+					   EXT4_IOS_BLOCK_BITMAP, 1);
 			err = ext4_handle_dirty_metadata(handle,
 							NULL, block_bitmap_bh);
 		}
@@ -977,6 +987,8 @@ got:
 			goto fail;
 	}
 	BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, group_desc_bh, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh);
 	if (err)
 		goto fail;
@@ -1326,6 +1338,8 @@ skip_zeroout:
 
 	BUFFER_TRACE(group_desc_bh,
 		     "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, group_desc_bh, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	ret = ext4_handle_dirty_metadata(handle, NULL,
 					 group_desc_bh);
 
diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
index 0f61f2f..53bcf69 100644
--- a/fs/ext4/indirect.c
+++ b/fs/ext4/indirect.c
@@ -508,6 +508,8 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode,
 		unlock_buffer(bh);
 
 		BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, bh, __func__, __LINE__,
+				   EXT4_IOS_INDIRECT_BLOCK, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, bh);
 		if (err)
 			goto failed;
@@ -595,6 +597,8 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode,
 		 */
 		jbd_debug(5, "splicing indirect only\n");
 		BUFFER_TRACE(where->bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, where->bh, __func__, __LINE__,
+				   EXT4_IOS_INDIRECT_BLOCK, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, where->bh);
 		if (err)
 			goto err_out;
@@ -1088,6 +1092,8 @@ static int ext4_clear_blocks(handle_t *handle, struct inode *inode,
 	if (try_to_extend_transaction(handle, inode)) {
 		if (bh) {
 			BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+			ext4_io_stat_write(handle, bh, __func__, __LINE__,
+					   EXT4_IOS_INDIRECT_BLOCK, 1);
 			err = ext4_handle_dirty_metadata(handle, inode, bh);
 			if (unlikely(err))
 				goto out_err;
@@ -1198,9 +1204,11 @@ static void ext4_free_data(handle_t *handle, struct inode *inode,
 		 * block pointed to itself, it would have been detached when
 		 * the block was cleared. Check for this instead of OOPSing.
 		 */
-		if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
+		if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh)) {
+			ext4_io_stat_write(handle, this_bh, __func__, __LINE__,
+					   EXT4_IOS_INDIRECT_BLOCK, 1);
 			ext4_handle_dirty_metadata(handle, inode, this_bh);
-		else
+		} else
 			EXT4_ERROR_INODE(inode,
 					 "circular indirect block detected at "
 					 "block %llu",
@@ -1324,6 +1332,9 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
 					*p = 0;
 					BUFFER_TRACE(parent_bh,
 					"call ext4_handle_dirty_metadata");
+					ext4_io_stat_write(handle, parent_bh,
+						__func__, __LINE__,
+						EXT4_IOS_INDIRECT_BLOCK, 1);
 					ext4_handle_dirty_metadata(handle,
 								   inode,
 								   parent_bh);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3179252..50017dc 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -623,6 +623,8 @@ struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode,
 		}
 		unlock_buffer(bh);
 		BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, bh, __func__, __LINE__,
+				   EXT4_IOS_DIR_ENTRY, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, bh);
 		if (!fatal)
 			fatal = err;
@@ -1786,6 +1788,8 @@ static int ext4_writepage(struct page *page,
 	struct inode *inode = page->mapping->host;
 
 	trace_ext4_writepage(page);
+	ext4_io_stat_write(NULL, NULL, __func__, __LINE__,
+			   EXT4_IOS_REGULAR_DATA, ext4_blocks_per_page(inode));
 	size = i_size_read(inode);
 	if (page->index == size >> PAGE_CACHE_SHIFT)
 		len = size & ~PAGE_CACHE_MASK;
@@ -1956,6 +1960,9 @@ static int write_cache_pages_da(struct address_space *mapping,
 			logical = (sector_t) page->index <<
 				(PAGE_CACHE_SHIFT - inode->i_blkbits);
 
+			ext4_io_stat_write(NULL, NULL, __func__, __LINE__,
+					   EXT4_IOS_REGULAR_DATA,
+					   ext4_blocks_per_page(inode));
 			if (!page_has_buffers(page)) {
 				mpage_add_bh_to_extent(mpd, logical,
 						       PAGE_CACHE_SIZE,
@@ -3083,6 +3090,8 @@ int ext4_block_zero_page_range(handle_t *handle,
 	} else {
 		if (ext4_should_order_data(inode) && EXT4_I(inode)->jinode)
 			err = ext4_jbd2_file_inode(handle, inode);
+		ext4_io_stat_write(handle, bh, __func__, __LINE__,
+				   EXT4_IOS_REGULAR_DATA, 1);
 		mark_buffer_dirty(bh);
 	}
 
@@ -3717,6 +3726,9 @@ static int ext4_do_update_inode(handle_t *handle,
 					EXT4_FEATURE_RO_COMPAT_LARGE_FILE);
 			sb->s_dirt = 1;
 			ext4_handle_sync(handle);
+			ext4_io_stat_write(handle, EXT4_SB(sb)->s_sbh,
+					   __func__, __LINE__,
+					   EXT4_IOS_SUPER_BLOCK, 1);
 			err = ext4_handle_dirty_metadata(handle, NULL,
 					EXT4_SB(sb)->s_sbh);
 		}
@@ -3746,6 +3758,8 @@ static int ext4_do_update_inode(handle_t *handle,
 	}
 
 	BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, bh, __func__, __LINE__,
+			   EXT4_IOS_INODE_TABLE, 1);
 	rc = ext4_handle_dirty_metadata(handle, NULL, bh);
 	if (!err)
 		err = rc;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index d961d17..1e872e1 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2805,6 +2805,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
 		ext4_set_bits(bitmap_bh->b_data, ac->ac_b_ex.fe_start,
 			      ac->ac_b_ex.fe_len);
 		ext4_unlock_group(sb, ac->ac_b_ex.fe_group);
+		ext4_io_stat_write(handle, bitmap_bh, __func__, __LINE__,
+				   EXT4_IOS_BLOCK_BITMAP, 1);
 		err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 		if (!err)
 			err = -EAGAIN;
@@ -2849,9 +2851,13 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
 			   &sbi->s_flex_groups[flex_group].free_blocks);
 	}
 
+	ext4_io_stat_write(handle, bitmap_bh, __func__, __LINE__,
+			   EXT4_IOS_BLOCK_BITMAP, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 	if (err)
 		goto out_err;
+	ext4_io_stat_write(handle, gdp_bh, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, gdp_bh);
 
 out_err:
@@ -4655,10 +4661,14 @@ do_more:
 
 	/* We dirtied the bitmap block */
 	BUFFER_TRACE(bitmap_bh, "dirtied bitmap block");
+	ext4_io_stat_write(handle, bitmap_bh, __func__, __LINE__,
+			   EXT4_IOS_BLOCK_BITMAP, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 
 	/* And the group descriptor block */
 	BUFFER_TRACE(gd_bh, "dirtied group descriptor block");
+	ext4_io_stat_write(handle, gd_bh, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	ret = ext4_handle_dirty_metadata(handle, NULL, gd_bh);
 	if (!err)
 		err = ret;
@@ -4796,10 +4806,14 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,
 
 	/* We dirtied the bitmap block */
 	BUFFER_TRACE(bitmap_bh, "dirtied bitmap block");
+	ext4_io_stat_write(handle, bitmap_bh, __func__, __LINE__,
+			   EXT4_IOS_BLOCK_BITMAP, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 
 	/* And the group descriptor block */
 	BUFFER_TRACE(gd_bh, "dirtied group descriptor block");
+	ext4_io_stat_write(handle, gd_bh, __func__, __LINE__,
+			   EXT4_IOS_GROUP_DESC, 1);
 	ret = ext4_handle_dirty_metadata(handle, NULL, gd_bh);
 	if (!err)
 		err = ret;
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index ba3f5b8..3ef6e32 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1227,9 +1227,13 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
 		de = de2;
 	}
 	dx_insert_block(frame, hash2 + continued, newblock);
+	ext4_io_stat_write(handle, bh2, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	err = ext4_handle_dirty_metadata(handle, dir, bh2);
 	if (err)
 		goto journal_error;
+	ext4_io_stat_write(handle, frame->bh, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	err = ext4_handle_dirty_metadata(handle, dir, frame->bh);
 	if (err)
 		goto journal_error;
@@ -1327,6 +1331,8 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
 	dir->i_version++;
 	ext4_mark_inode_dirty(handle, dir);
 	BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, bh, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	err = ext4_handle_dirty_metadata(handle, dir, bh);
 	if (err)
 		ext4_std_error(dir->i_sb, err);
@@ -1417,7 +1423,11 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
 	frame->bh = bh;
 	bh = bh2;
 
+	ext4_io_stat_write(handle, frame->bh, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	ext4_handle_dirty_metadata(handle, dir, frame->bh);
+	ext4_io_stat_write(handle, bh, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	ext4_handle_dirty_metadata(handle, dir, bh);
 
 	de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
@@ -1592,6 +1602,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 			dxtrace(dx_show_index("node", frames[1].entries));
 			dxtrace(dx_show_index("node",
 			       ((struct dx_node *) bh2->b_data)->entries));
+			ext4_io_stat_write(handle, bh2, __func__, __LINE__,
+					   EXT4_IOS_DIR_ENTRY, 1);
 			err = ext4_handle_dirty_metadata(handle, inode, bh2);
 			if (err)
 				goto journal_error;
@@ -1618,6 +1630,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 			if (err)
 				goto journal_error;
 		}
+		ext4_io_stat_write(handle, frames[0].bh, __func__, __LINE__,
+				   EXT4_IOS_DIR_ENTRY, 1);
 		err = ext4_handle_dirty_metadata(handle, inode, frames[0].bh);
 		if (err) {
 			ext4_std_error(inode->i_sb, err);
@@ -1676,6 +1690,8 @@ static int ext4_delete_entry(handle_t *handle,
 				de->inode = 0;
 			dir->i_version++;
 			BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+			ext4_io_stat_write(handle, bh, __func__, __LINE__,
+					   EXT4_IOS_DIR_ENTRY, 1);
 			err = ext4_handle_dirty_metadata(handle, dir, bh);
 			if (unlikely(err)) {
 				ext4_std_error(dir->i_sb, err);
@@ -1869,6 +1885,8 @@ retry:
 	ext4_set_de_type(dir->i_sb, de, S_IFDIR);
 	inode->i_nlink = 2;
 	BUFFER_TRACE(dir_block, "call ext4_handle_dirty_metadata");
+	ext4_io_stat_write(handle, dir_block, __func__, __LINE__,
+			   EXT4_IOS_DIR_ENTRY, 1);
 	err = ext4_handle_dirty_metadata(handle, dir, dir_block);
 	if (err)
 		goto out_clear_inode;
@@ -2020,6 +2038,8 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
 	/* Insert this inode at the head of the on-disk orphan list... */
 	NEXT_ORPHAN(inode) = le32_to_cpu(EXT4_SB(sb)->s_es->s_last_orphan);
 	EXT4_SB(sb)->s_es->s_last_orphan = cpu_to_le32(inode->i_ino);
+	ext4_io_stat_write(handle, EXT4_SB(sb)->s_sbh, __func__, __LINE__,
+			   EXT4_IOS_SUPER_BLOCK, 1);
 	err = ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
 	rc = ext4_mark_iloc_dirty(handle, inode, &iloc);
 	if (!err)
@@ -2093,6 +2113,8 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode)
 		if (err)
 			goto out_brelse;
 		sbi->s_es->s_last_orphan = cpu_to_le32(ino_next);
+		ext4_io_stat_write(handle, sbi->s_sbh, __func__, __LINE__,
+				   EXT4_IOS_SUPER_BLOCK, 1);
 		err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
 	} else {
 		struct ext4_iloc iloc2;
@@ -2482,6 +2504,8 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
 					ext4_current_time(new_dir);
 		ext4_mark_inode_dirty(handle, new_dir);
 		BUFFER_TRACE(new_bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, new_bh, __func__, __LINE__,
+				   EXT4_IOS_DIR_ENTRY, 1);
 		retval = ext4_handle_dirty_metadata(handle, new_dir, new_bh);
 		if (unlikely(retval)) {
 			ext4_std_error(new_dir->i_sb, retval);
@@ -2536,6 +2560,8 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
 		PARENT_INO(dir_bh->b_data, new_dir->i_sb->s_blocksize) =
 						cpu_to_le32(new_dir->i_ino);
 		BUFFER_TRACE(dir_bh, "call ext4_handle_dirty_metadata");
+		ext4_io_stat_write(handle, dir_bh, __func__, __LINE__,
+				   EXT4_IOS_DIR_ENTRY, 1);
 		retval = ext4_handle_dirty_metadata(handle, old_dir, dir_bh);
 		if (retval) {
 			ext4_std_error(old_dir->i_sb, retval);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 49a5952..93ec9a7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4113,6 +4113,8 @@ static int ext4_commit_super(struct super_block *sb, int sync)
 				&EXT4_SB(sb)->s_freeinodes_counter));
 	sb->s_dirt = 0;
 	BUFFER_TRACE(sbh, "marking dirty");
+	ext4_io_stat_write(NULL, sbh, __func__, __LINE__,
+			   EXT4_IOS_SUPER_BLOCK, 1);
 	mark_buffer_dirty(sbh);
 	if (sync) {
 		error = sync_dirty_buffer(sbh);
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index cb7a9bb..640b549 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -495,6 +495,8 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode,
 				 EXT4_FREE_BLOCKS_FORGET);
 	} else {
 		le32_add_cpu(&BHDR(bh)->h_refcount, -1);
+		ext4_io_stat_write(handle, bh, __func__, __LINE__,
+				   EXT4_IOS_EXTENDED_ATTR, 1);
 		error = ext4_handle_dirty_metadata(handle, inode, bh);
 		if (IS_SYNC(inode))
 			ext4_handle_sync(handle);
@@ -733,10 +735,14 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
 			unlock_buffer(bs->bh);
 			if (error == -EIO)
 				goto bad_block;
-			if (!error)
+			if (!error) {
+				ext4_io_stat_write(handle, bs->bh,
+						   __func__, __LINE__,
+						   EXT4_IOS_EXTENDED_ATTR, 1);
 				error = ext4_handle_dirty_metadata(handle,
 								   inode,
 								   bs->bh);
+			}
 			if (error)
 				goto cleanup;
 			goto inserted;
@@ -805,6 +811,9 @@ inserted:
 				ea_bdebug(new_bh, "reusing; refcount now=%d",
 					le32_to_cpu(BHDR(new_bh)->h_refcount));
 				unlock_buffer(new_bh);
+				ext4_io_stat_write(handle, new_bh,
+						   __func__, __LINE__,
+						   EXT4_IOS_EXTENDED_ATTR, 1);
 				error = ext4_handle_dirty_metadata(handle,
 								   inode,
 								   new_bh);
@@ -857,6 +866,8 @@ getblk_failed:
 			set_buffer_uptodate(new_bh);
 			unlock_buffer(new_bh);
 			ext4_xattr_cache_insert(new_bh);
+			ext4_io_stat_write(handle, new_bh, __func__, __LINE__,
+					   EXT4_IOS_EXTENDED_ATTR, 1);
 			error = ext4_handle_dirty_metadata(handle,
 							   inode, new_bh);
 			if (error)
-- 
1.7.4.1


^ permalink raw reply related

* Re: [PATCH RFC v2 03/13] libxl: Provide a version of bsd's queue.h as _libxl_list.h
From: Ian Campbell @ 2011-10-31  9:43 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <1319827031-15395-4-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> @@ -18,6 +18,14 @@ GPLv2. See the FSF's definition of GPL compatibility:
>  And how this applies to a range of open source licenses:
>   http://www.gnu.org/licenses/license-list.html
> 
> +Additionally, the documentation file tools/libxl/external/bsd-queue.3
> +has the 4-clause BSD licence.  It is present in the Xen source tree
> +for reference purposes for people developing Xen.  It is not installed
> +by "make install" and is bundled in the source only for convenience of
> +distribution.  We do not intend that we or Xen users or distributors
> +should make any reference to "features or use" of that manpage.

Anil pointed to the OpenBSD version of this page which has that clause
removed. It would simplify things to use their version (of the header
too for consistency)?  We are probably not comfortable with just
rescinding the clause ourselves?

Otherwise I'm happy with this, so:

Acked-by: Ian Campbell <Ian.campbell@citrix.com>

Also Roger previously supplied a

Tested-by: Roger Pau Monne <roger.pau@entel.upc.edu>

> +[...]

^ permalink raw reply

* Re: [PATCH] mfd: adp5520: Ensure setting bits if new value is different from the old value
From: Michael Hennerich @ 2011-10-31  9:43 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel@vger.kernel.org, Michael Hennerich, Samuel Ortiz,
	device-drivers-devel@blackfin.uclinux.org
In-Reply-To: <1320030006.2690.8.camel@phoenix>

On 10/31/2011 04:00 AM, Axel Lin wrote:
> Current code checks if all the bit_mask bits are all zero is wrong.
> We need to write new value if the bit mask fields of new value is
> not equal to old value.
>
> Signed-off-by: Axel Lin<axel.lin@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>

Right - the da903x suffers the same problem.

> ---
>   drivers/mfd/adp5520.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
> index f1d8848..8d816cc 100644
> --- a/drivers/mfd/adp5520.c
> +++ b/drivers/mfd/adp5520.c
> @@ -109,7 +109,7 @@ int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask)
>
>   	ret = __adp5520_read(chip->client, reg,&reg_val);
>
> -	if (!ret&&  ((reg_val&  bit_mask) == 0)) {
> +	if (!ret&&  ((reg_val&  bit_mask) != bit_mask)) {
>   		reg_val |= bit_mask;
>   		ret = __adp5520_write(chip->client, reg, reg_val);
>   	}


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



^ permalink raw reply

* Re: [PATCH RFC v2 04/13] libxl: idl: support new "c_only" type attribute
From: Ian Campbell @ 2011-10-31  9:46 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <1319827031-15395-5-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> This provides for fields in libxl datatypes which are only present in
> the C version of structures.  This is useful, for example, when a
> libxl datatype wants to contain fields which are used by libxl
> internally and which are only present in the structure to avoid
> additional memory allocation inconvenience.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  tools/libxl/gentest.py    |    2 ++
>  tools/libxl/libxltypes.py |    4 +++-
>  2 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
> index 6697ac5..ed5358d 100644
> --- a/tools/libxl/gentest.py
> +++ b/tools/libxl/gentest.py
> @@ -56,6 +56,8 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
>          s += "%s = rand() %% 2;\n" % v
>      elif ty.typename in ["char *"]:
>          s += "%s = rand_str();\n" % v
> +    elif ty.c_only:
> +        pass
>      elif ty.typename in handcoded:
>          raise Exception("Gen for handcoded %s" % ty.typename)
>      else:
> diff --git a/tools/libxl/libxltypes.py b/tools/libxl/libxltypes.py
> index 05cba88..83a9426 100644
> --- a/tools/libxl/libxltypes.py
> +++ b/tools/libxl/libxltypes.py
> @@ -33,6 +33,8 @@ class Type(object):
>          if self.passby not in [PASS_BY_VALUE, PASS_BY_REFERENCE]:
>              raise ValueError
>  
> +        self.c_only = kwargs.setdefault('c_only', False)
> +
>          if typename is None: # Anonymous type
>              self.typename = None
>              self.rawname = None
> @@ -50,7 +52,7 @@ class Type(object):
>  
>          self.autogenerate_destructor = kwargs.setdefault('autogenerate_destructor', True)
>  
> -        if self.typename is not None:
> +        if self.typename is not None and not self.c_only:
>              self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
>          else:
>              self.json_fn = kwargs.setdefault('json_fn', None)

^ permalink raw reply

* Re: [PATCH 0/2] ACPI: Re-factor and remove ./drivers/acpi/atomicio.[ch]
From: Thomas Renninger @ 2011-10-31 10:47 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Myron Stowe, Len Brown, bondd, lenb, linux-acpi, rjw, ying.huang
In-Reply-To: <CAErSpo5waF5Nz92d612tp60bV=oLNyb=yo1xh6_TMhGSvQ07tw@mail.gmail.com>

On Friday 28 October 2011 17:03:03 Bjorn Helgaas wrote:
> On Thu, Oct 27, 2011 at 7:49 PM, Thomas Renninger <trenn@suse.de> wrote:
> > On Thursday 29 September 2011 23:59:08 Myron Stowe wrote:
> > ..
> >> Myron Stowe (2):
> >>       ACPI: Convert acpi_pre_map_gar()/acpi_atomic_read() and remove ./drivers/acpi/atomicio.[ch]
> >>       ACPI: Export interfaces for ioremapping/iounmapping ACPI registers
> >
> > Would be great to know whether these are going to be accepted.
> > If yes, this check should get removed as well:
> >
> > drivers/acpi/acpica/hwregs.c:
> > acpi_status
> > acpi_hw_validate_register(struct acpi_generic_address *reg,
> >                          u8 max_bit_width, u64 *address)
> > {
> > ...
> >        if (reg->bit_offset != 0) {
> >                ACPI_WARNING((AE_INFO,
> >                              "Unsupported register bit offset: 0x%X",
> >                              reg->bit_offset));
> >        }
> >
> > because APEI GAR declarations do use bit_offset != 0.
> 
> Half of this makes sense to me.  Myron's patch changes APEI from using
> acpi_atomic_read() (which doesn't call acpi_hw_validate_register()) to
> using acpi_read(), which *does* call it.  So after Myron's patch,
> we'll see warnings we didn't see before.
> 
> The part that doesn't make sense to me is just removing the warning.
> That warning looks to me like it's saying "oops, here's something we
> should support, but haven't implemented yet."  Wouldn't it be better
> to implement support for bit_offset in acpi_read() at the same time we
> remove the warning?  Then Myron could update his patch to drop the
> bit_offset support in __apei_exec_read_register() when converting to
> acpi_read().
> 
> If APEI uses bit_offset != 0, it's at least possible that other areas
> will use it in the future, and it'd be nicer to have all the support
> in acpi_read() rather than forcing APEI and others to each implement
> their own support for it.
Googling for the warning:
"Unsupported register bit offset"
only points to code snippets.
The code needs to be compatible with a long history of ACPI table
implementations (the reason why I thought to keep bit offset handling
in APEI code for now is the safer approach). But bit_offset != 0 seem
to only appear in latest APEI table implementations.
Looks like this condition was never run into and it should be safe
to add bit offset support to these generic parts.
-> I agree that bit offset handling can/should get added there.

Still, if Windows has duplicated code for APEI GAR handling (with
additional mask value, for example ignoring bit width) and does it
slightly different than they do it in other parts,
we also might not come around APEI specific GAR checking/workarounds.

   Thomas

^ permalink raw reply

* Re: [PATCH RFC v2 05/13] libxl: idl: Provide struct and union tags
From: Ian Campbell @ 2011-10-31  9:47 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <1319827031-15395-6-git-send-email-ian.jackson@eu.citrix.com>

On Fri, 2011-10-28 at 19:37 +0100, Ian Jackson wrote:
> Instead of generating:
> 
>    typedef struct {
>      ...
>    } libxl_foo;
> 
> Produce:
> 
>    typedef struct libxl_foo {
>      ...
>    } libxl_foo;
> 
> This makes it possible to refer to libxl idl-generated structs and
> unions, as incomplete types, before they have been defined.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  tools/libxl/gentypes.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
> index e82b706..c4efbf3 100644
> --- a/tools/libxl/gentypes.py
> +++ b/tools/libxl/gentypes.py
> @@ -56,7 +56,7 @@ def libxl_C_type_define(ty, indent = ""):
>          if ty.typename is None:
>              s += "%s {\n" % ty.kind
>          else:
> -            s += "typedef %s {\n" % ty.kind
> +            s += "typedef %s %s {\n" % (ty.kind, ty.typename)
>  
>          for f in ty.fields:
>              if f.comment is not None:

^ permalink raw reply

* Re: [B.A.T.M.A.N.] [PATCH 0/6] DAT: Distributed ARP Table
From: Simon Wunderlich @ 2011-10-31  9:48 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking
In-Reply-To: <201110311042.33719.lindner_marek@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

+1

:)

On Mon, Oct 31, 2011 at 10:42:33AM +0100, Marek Lindner wrote:
> On Monday, October 31, 2011 10:26:39 Martin Hundebøll wrote:
> > On 2011-10-31 01:03, Simon Wunderlich wrote:
> > > Hello Antonio,
> > > 
> > > thanks for the patchset! I've tested it again in my kvm setup, it worked
> > > very well.
> > > 
> > > There are some issues remaining, I'll comment the individual patches for
> > > this.
> > > 
> > > About the general stuff:
> > >   * maybe we should rename arp.{c|h} to dat.{c|h} to avoid confusion with
> > >   
> > >     other code in the linux kernel?
> > 
> > I propose "distributet-arp-tables.{c|h}" to avoid too many acronyms in our
> > file names.
> 
> I second that but I suggest:
> distributed-arp-tables.{c|h}
> 
> Regards,
> Marek
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: [PATCH] mfd: Add missed free_irq in da903x_remove
From: Eric Miao @ 2011-10-31  9:48 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Mike Rapoport, Samuel Ortiz
In-Reply-To: <1320028441.2690.3.camel@phoenix>

On Mon, Oct 31, 2011 at 10:34 AM, Axel Lin <axel.lin@gmail.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Eric Miao <eric.y.miao@gmail.com>

> ---
>  drivers/mfd/da903x.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c
> index 1b79c37..62ce685 100644
> --- a/drivers/mfd/da903x.c
> +++ b/drivers/mfd/da903x.c
> @@ -549,6 +549,7 @@ static int __devexit da903x_remove(struct i2c_client *client)
>        struct da903x_chip *chip = i2c_get_clientdata(client);
>
>        da903x_remove_subdevs(chip);
> +       free_irq(client->irq, chip);
>        kfree(chip);
>        return 0;
>  }
> --
> 1.7.5.4
>
>
>
>

^ permalink raw reply

* Re: [B.A.T.M.A.N.] batman miss crc16 module after nico commit
From: Marek Lindner @ 2011-10-31  9:48 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: riot-workshop, Nodi Roma List
In-Reply-To: <CAOaDhSSVMx1eN1G5rZ6-zh8Kh8xoddUOiQ0ua4StaX5bLHVQ7w@mail.gmail.com>


Hi,

> After nico commit [0] batman-adv stopped working in openwrt backfire (
> the crc16 modules is still kmod-crc16 in openwrt stable )
> 
> the batman-adv module refuse to load without error message on stdout
> but saying that crc16 is missing on dmesg
> 
> 
> selecting manually kernel modules -> other modules -> kmod-crc16 it work
> again
> 
> [0] 
> https://dev.openwrt.org/changeset/28657/packages/net/batman-adv/Makefile

the OpenWrt developers have renamed the package dependency. Unless you are 
using the OpenWrt trunk after revision 28656 the package dependency selection 
won't work anymore.

Maybe you should ask them about their concept of backward compatibility.

Cheers,
Marek

^ permalink raw reply


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.