* [PATCH] taskstats: Use better ifdef for alignment @ 2010-12-30 0:12 Jeff Mahoney 2010-12-30 0:14 ` Andrew Morton 2010-12-31 0:23 ` David Miller 0 siblings, 2 replies; 11+ messages in thread From: Jeff Mahoney @ 2010-12-30 0:12 UTC (permalink / raw) To: Andrew Morton, David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List Commit 4be2c95d added a null field to align the taskstats structure but the discussion centered around ia64. The issue exists on other platforms with inefficient unaligned access and adding them piecemeal would be an unmaintainable mess. This patch uses Dave Miller's suggestion of using a combination of CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine whether alignment is needed. Note that this will cause breakage on those platforms with applications like iotop which had hard-coded offsets into the packet to access the taskstats structure. The message seen on systems without the alignment fixes looks like: kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 The addresses may vary but resolve to locations inside __delayacct_add_tsk. Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- kernel/taskstats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -349,7 +349,7 @@ static int parse(struct nlattr *na, stru return ret; } -#ifdef CONFIG_IA64 +#if defined(CONFIG_64BIT) && !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) #define TASKSTATS_NEEDS_PADDING 1 #endif ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 0:12 [PATCH] taskstats: Use better ifdef for alignment Jeff Mahoney @ 2010-12-30 0:14 ` Andrew Morton 2010-12-30 5:26 ` Jeff Mahoney 2010-12-31 0:23 ` David Miller 1 sibling, 1 reply; 11+ messages in thread From: Andrew Morton @ 2010-12-30 0:14 UTC (permalink / raw) To: Jeff Mahoney Cc: David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List On Wed, 29 Dec 2010 19:12:08 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > Commit 4be2c95d added a null field to align the taskstats structure but > the discussion centered around ia64. The issue exists on other platforms > with inefficient unaligned access and adding them piecemeal would be > an unmaintainable mess. > > This patch uses Dave Miller's suggestion of using a combination of > CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine > whether alignment is needed. > > Note that this will cause breakage on those platforms with applications > like iotop which had hard-coded offsets into the packet to access the > taskstats structure. That seems a very good reason to not apply the patch. Tell us more, please... > The message seen on systems without the alignment fixes looks like: > kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 > > The addresses may vary but resolve to locations inside __delayacct_add_tsk. > > Reported-by: David S. Miller <davem@davemloft.net> > Signed-off-by: Jeff Mahoney <jeffm@suse.com> > --- > kernel/taskstats.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/kernel/taskstats.c > +++ b/kernel/taskstats.c > @@ -349,7 +349,7 @@ static int parse(struct nlattr *na, stru > return ret; > } > > -#ifdef CONFIG_IA64 > +#if defined(CONFIG_64BIT) && !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) > #define TASKSTATS_NEEDS_PADDING 1 > #endif > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 0:14 ` Andrew Morton @ 2010-12-30 5:26 ` Jeff Mahoney 2010-12-30 5:32 ` Andrew Morton 0 siblings, 1 reply; 11+ messages in thread From: Jeff Mahoney @ 2010-12-30 5:26 UTC (permalink / raw) To: Andrew Morton Cc: David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/29/2010 07:14 PM, Andrew Morton wrote: > On Wed, 29 Dec 2010 19:12:08 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > >> Commit 4be2c95d added a null field to align the taskstats structure but >> the discussion centered around ia64. The issue exists on other platforms >> with inefficient unaligned access and adding them piecemeal would be >> an unmaintainable mess. >> >> This patch uses Dave Miller's suggestion of using a combination of >> CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine >> whether alignment is needed. >> >> Note that this will cause breakage on those platforms with applications >> like iotop which had hard-coded offsets into the packet to access the >> taskstats structure. > > That seems a very good reason to not apply the patch. > > Tell us more, please... I don't want to rehash the same discussion, but any argument that applied to ia64 applies any other 64-bit arch other than powerpc and x86_64. - -Jeff >> The message seen on systems without the alignment fixes looks like: >> kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 >> >> The addresses may vary but resolve to locations inside __delayacct_add_tsk. >> >> Reported-by: David S. Miller <davem@davemloft.net> >> Signed-off-by: Jeff Mahoney <jeffm@suse.com> >> --- >> kernel/taskstats.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> --- a/kernel/taskstats.c >> +++ b/kernel/taskstats.c >> @@ -349,7 +349,7 @@ static int parse(struct nlattr *na, stru >> return ret; >> } >> >> -#ifdef CONFIG_IA64 >> +#if defined(CONFIG_64BIT) && !defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) >> #define TASKSTATS_NEEDS_PADDING 1 >> #endif >> - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0cGAoACgkQLPWxlyuTD7IdTwCfXZ0KfZ3N/zafSzGCSa4cHEbN EU8AoI/JK/1nkv5xHw4XP79wZAGo4hqk =jAGp -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 5:26 ` Jeff Mahoney @ 2010-12-30 5:32 ` Andrew Morton 2010-12-30 15:52 ` Jeff Mahoney 0 siblings, 1 reply; 11+ messages in thread From: Andrew Morton @ 2010-12-30 5:32 UTC (permalink / raw) To: Jeff Mahoney Cc: David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List On Thu, 30 Dec 2010 00:26:34 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > On 12/29/2010 07:14 PM, Andrew Morton wrote: > > On Wed, 29 Dec 2010 19:12:08 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > > > >> Commit 4be2c95d added a null field to align the taskstats structure but > >> the discussion centered around ia64. The issue exists on other platforms > >> with inefficient unaligned access and adding them piecemeal would be > >> an unmaintainable mess. > >> > >> This patch uses Dave Miller's suggestion of using a combination of > >> CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine > >> whether alignment is needed. > >> > >> Note that this will cause breakage on those platforms with applications > >> like iotop which had hard-coded offsets into the packet to access the > >> taskstats structure. > > > > That seems a very good reason to not apply the patch. > > > > Tell us more, please... > > I don't want to rehash the same discussion Please do so. That discussion went on for a long time over many emails and multiple iterations of the patch. I personally have forgotten the reasoning and if I could remember it, I wouldn't remember which version of the patch it applied to. Applying a patch which is *known* to break *known* userspace applications is a quite extraordinary thing to do. We owe it to people to fully explain the reasoning. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 5:32 ` Andrew Morton @ 2010-12-30 15:52 ` Jeff Mahoney 2011-01-01 16:19 ` Florian Mickler 0 siblings, 1 reply; 11+ messages in thread From: Jeff Mahoney @ 2010-12-30 15:52 UTC (permalink / raw) To: Andrew Morton Cc: David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/30/2010 12:32 AM, Andrew Morton wrote: > On Thu, 30 Dec 2010 00:26:34 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > >> On 12/29/2010 07:14 PM, Andrew Morton wrote: >>> On Wed, 29 Dec 2010 19:12:08 -0500 Jeff Mahoney <jeffm@suse.com> wrote: >>> >>>> Commit 4be2c95d added a null field to align the taskstats structure but >>>> the discussion centered around ia64. The issue exists on other platforms >>>> with inefficient unaligned access and adding them piecemeal would be >>>> an unmaintainable mess. >>>> >>>> This patch uses Dave Miller's suggestion of using a combination of >>>> CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine >>>> whether alignment is needed. >>>> >>>> Note that this will cause breakage on those platforms with applications >>>> like iotop which had hard-coded offsets into the packet to access the >>>> taskstats structure. >>> >>> That seems a very good reason to not apply the patch. >>> >>> Tell us more, please... >> >> I don't want to rehash the same discussion > > Please do so. That discussion went on for a long time over many emails > and multiple iterations of the patch. I personally have forgotten the > reasoning and if I could remember it, I wouldn't remember which version > of the patch it applied to. > > Applying a patch which is *known* to break *known* userspace > applications is a quite extraordinary thing to do. We owe it to people > to fully explain the reasoning. Ok, so the gist is that iotop makes what I'd call unreasonable assumptions about the contents of a netlink genetlink packet containing generic attributes. They're typed and have headers that specify value lengths, so the client can (should) identify and skip the ones the client doesn't understand. The kernel, as of version 2.6.36, presented a packet like so: +--------------------------------+ | genlmsghdr - 4 bytes | +--------------------------------+ | NLA header - 4 bytes | /* Aggregate header */ +-+------------------------------+ | | NLA header - 4 bytes | /* PID header */ | +------------------------------+ | | pid/tgid - 4 bytes | | +------------------------------+ | | NLA header - 4 bytes | /* stats header */ | + -----------------------------+ <- oops. aligned on 4 byte boundary | | struct taskstats - 328 bytes | +-+------------------------------+ The iotop code expects that the kernel will behave as it did then, assuming that the packet format is set in stone. The format is set in stone, but the packet offsets are not. There's nothing in the packet format that guarantees that the packet will be sent in exactly the same way. The attribute contents are set (or versioned) and the aggregate contents are set but they can be anywhere in the packet. The issue here isn't that an unaligned structure gets passed to userspace, it's that the NLA infrastructure has something of a weakness: The 4 byte attribute header may force the payload to be unaligned. The taskstats structure is created at an unaligned location and then 64-bit values are operated on inside the kernel, so the unaligned access warnings gets spewed everywhere. It's possible to use the unaligned access API to operate on the structure in the kernel but it seems like a wasted effort to work around userspace code that isn't following the packet format. Any new additions would also need the be worked around. It's a maintenance nightmare. The conclusion of the earlier discussion seemed to be "ok fine, if we have to break it, don't break it on arches that don't have the problem." Dave pointed out that the unaligned access problem doesn't only exist on ia64, but also on other 64-bit arches that don't have efficient unaligned access and it should be fixed there as well. The committed version of the patch and this addition keep with the conclusion of that discussion not to break it unnecessarily, which the pid padding and the packet padding fixes did do. x86_64 and powerpc don't suffer this problem so they shouldn't suffer the solution. Other 64-bit architectures do and will, though. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0cqqEACgkQLPWxlyuTD7KOtQCggszltwXS5RZwaJ9GYFI6XKj6 nyUAn30jbAJfICD0NtKLgTswee48V1jI =WnDa -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 15:52 ` Jeff Mahoney @ 2011-01-01 16:19 ` Florian Mickler 2011-01-01 16:51 ` Dan Carpenter 0 siblings, 1 reply; 11+ messages in thread From: Florian Mickler @ 2011-01-01 16:19 UTC (permalink / raw) To: Jeff Mahoney Cc: Andrew Morton, David S. Miller, Dan Carpenter, balbir, Linux Kernel Mailing List On Thu, 30 Dec 2010 10:52:01 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 12/30/2010 12:32 AM, Andrew Morton wrote: > > On Thu, 30 Dec 2010 00:26:34 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > > > >> On 12/29/2010 07:14 PM, Andrew Morton wrote: > >>> On Wed, 29 Dec 2010 19:12:08 -0500 Jeff Mahoney <jeffm@suse.com> wrote: > >>> > >>>> Commit 4be2c95d added a null field to align the taskstats structure but > >>>> the discussion centered around ia64. The issue exists on other platforms > >>>> with inefficient unaligned access and adding them piecemeal would be > >>>> an unmaintainable mess. > >>>> > >>>> This patch uses Dave Miller's suggestion of using a combination of > >>>> CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine > >>>> whether alignment is needed. > >>>> > >>>> Note that this will cause breakage on those platforms with applications > >>>> like iotop which had hard-coded offsets into the packet to access the > >>>> taskstats structure. > >>> > >>> That seems a very good reason to not apply the patch. > >>> > >>> Tell us more, please... > >> > >> I don't want to rehash the same discussion > > > > Please do so. That discussion went on for a long time over many emails > > and multiple iterations of the patch. I personally have forgotten the > > reasoning and if I could remember it, I wouldn't remember which version > > of the patch it applied to. > > > > Applying a patch which is *known* to break *known* userspace > > applications is a quite extraordinary thing to do. We owe it to people > > to fully explain the reasoning. > > Ok, so the gist is that iotop makes what I'd call unreasonable > assumptions about the contents of a netlink genetlink packet containing > generic attributes. Is there already a patch available or integrated into iotop which fixes this? I'd think that if the kernel could wait on fixed iotop's to be distributed it would be easier to sell the breakage on bugzilla & co... Just my 2 cents, but I don't know enough to weigh the different aspects of this... iotop shurely is not a showstopper if the upsides of this patch are big enough? Regards, Flo ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2011-01-01 16:19 ` Florian Mickler @ 2011-01-01 16:51 ` Dan Carpenter 2011-01-02 12:17 ` Florian Mickler 0 siblings, 1 reply; 11+ messages in thread From: Dan Carpenter @ 2011-01-01 16:51 UTC (permalink / raw) To: Florian Mickler Cc: Jeff Mahoney, Andrew Morton, David S. Miller, balbir, Linux Kernel Mailing List On Sat, Jan 01, 2011 at 05:19:46PM +0100, Florian Mickler wrote: > Is there already a patch available or integrated into iotop which > fixes this? I'd think that if the kernel could wait on fixed iotop's to > be distributed it would be easier to sell the breakage on bugzilla & > co... > The story is that 4be2c95d1f "taskstats: pad taskstats netlink response for aligment issues on ia64" broke iotop on 64 bit processors (32 bit was unaffected). This patch fixes it for x86-64 and powerpc-64. On the other 64 bit processors iotop works but instead you get a message in dmesg: kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 So on those arches you were already getting posts to bugzilla etc. Now those people can upgrade the kernel and download iotop version 0.4.2 or higher. regards, dan carpenter ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2011-01-01 16:51 ` Dan Carpenter @ 2011-01-02 12:17 ` Florian Mickler 2011-01-08 22:42 ` Florian Mickler 2011-01-08 22:46 ` Jeff Mahoney 0 siblings, 2 replies; 11+ messages in thread From: Florian Mickler @ 2011-01-02 12:17 UTC (permalink / raw) To: Dan Carpenter Cc: Jeff Mahoney, Andrew Morton, David S. Miller, balbir, Linux Kernel Mailing List On Sat, 1 Jan 2011 19:51:35 +0300 Dan Carpenter <error27@gmail.com> wrote: > On Sat, Jan 01, 2011 at 05:19:46PM +0100, Florian Mickler wrote: > > Is there already a patch available or integrated into iotop which > > fixes this? I'd think that if the kernel could wait on fixed iotop's to > > be distributed it would be easier to sell the breakage on bugzilla & > > co... > > > > The story is that 4be2c95d1f "taskstats: pad taskstats netlink response > for aligment issues on ia64" broke iotop on 64 bit processors (32 bit > was unaffected). This patch fixes it for x86-64 and powerpc-64. > > On the other 64 bit processors iotop works but instead you get a message > in dmesg: > kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 > > So on those arches you were already getting posts to bugzilla etc. Now > those people can upgrade the kernel and download iotop version 0.4.2 or > higher. > > regards, > dan carpenter > Ah ok. And probably bug #24272 is related to this. If I understood it correctly 85893120 fixed some runtime warnings (or more exactly the misaligning) and broke iotop in the process (on all of 64 bit). 4be2c95d1f undid that and enhanced the netlink messages on IA64 archs with a new type to fix the alignment and now it's changed to align well on all archs that need alignment, leaving archs unbroken that have efficient unaligned access (x86-64 and powerpc-64). Nice. And to answer my original question, i just checked out (some?/the?) iotop sources from git://repo.or.cz/iotop.git and found a fix[1] for the issue with 85893120. Is iotop parsing fixed to ignore the null-field in the meantime? Thx, Flo [1]git://repo.or.cz/iotop.git:commit 08211d209ae8fc7e67ea3bebb09979ff61c70f97 Author: Guillaume Chazarain <guichaz@gmail.com> Date: Sat Sep 4 13:57:43 2010 +0200 Instead of assuming the pid field is 4 bytes long, take its length from the header. This is needed for http://lkml.org/lkml/2010/2/12/167 [PATCH] delayacct: align to 8 byte boundary on 64-bit systems ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2011-01-02 12:17 ` Florian Mickler @ 2011-01-08 22:42 ` Florian Mickler 2011-01-08 22:46 ` Jeff Mahoney 1 sibling, 0 replies; 11+ messages in thread From: Florian Mickler @ 2011-01-08 22:42 UTC (permalink / raw) To: Linux Kernel Mailing List Cc: Dan Carpenter, Jeff Mahoney, Andrew Morton, David S. Miller, balbir, guichaz On Sun, 2 Jan 2011 13:17:47 +0100 Florian Mickler <florian@mickler.org> wrote: > On Sat, 1 Jan 2011 19:51:35 +0300 > Dan Carpenter <error27@gmail.com> wrote: > > > On Sat, Jan 01, 2011 at 05:19:46PM +0100, Florian Mickler wrote: > > > Is there already a patch available or integrated into iotop which > > > fixes this? I'd think that if the kernel could wait on fixed iotop's to > > > be distributed it would be easier to sell the breakage on bugzilla & > > > co... Ok, I sent a fix for the iotop parsing to Guillaume, but didn't receive any reaction... maybe someone here find's it useful... commit 392f7e7455c94cdc64aeb0353a79d22b4780687c Author: Florian Mickler <florian@mickler.org> Date: Tue Jan 4 12:03:25 2011 +0100 fix parsing of netlink messages The linux kernel may enhance the message with fields to pad the taskstats struct (commit 4be2c95d1f ["taskstats: pad taskstats netlink response for aligment issues on ia64"] in Linus tree). So now we honour the flexible format and extract the field we are interested in. diff --git a/iotop/data.py b/iotop/data.py index 1164344..c75c190 100644 --- a/iotop/data.py +++ b/iotop/data.py @@ -136,6 +136,7 @@ TASKSTATS_CMD_GET = 1 TASKSTATS_CMD_ATTR_PID = 1 TASKSTATS_TYPE_AGGR_PID = 4 TASKSTATS_TYPE_PID = 1 +TASKSTATS_TYPE_STATS = 3 class TaskStatsNetlink(object): # Keep in sync with format_stats() and pinfo.did_some_io() @@ -163,19 +164,23 @@ class TaskStatsNetlink(object): if len(reply.payload) < 292: # Short reply return - reply_length, reply_type = struct.unpack('HH', reply.payload[4:8]) - assert reply_length >= 288 - assert reply_type == TASKSTATS_TYPE_AGGR_PID - - pid_length, pid_type = struct.unpack('HH', reply.payload[8:12]) - assert pid_type == TASKSTATS_TYPE_PID - - taskstats_start = 4 + 4 + pid_length + 4 - taskstats_data = reply.payload[taskstats_start:] + reply.payload = reply.payload[4:] + data = get_data(TASKSTATS_TYPE_AGGR_PID, reply.payload) + assert( len(data) > 0) + taskstats_data = get_data(TASKSTATS_TYPE_STATS, data) taskstats_version = struct.unpack('H', taskstats_data[:2])[0] assert taskstats_version >= 4 return Stats(taskstats_data) +def get_data(field_type, payload): + while len(payload) > 3: + reply_length, reply_type = struct.unpack('HH', payload[:4]) + if (reply_type == field_type): + break + payload = payload[reply_length:] + + return payload[4:reply_length] + # # PIDs manipulations # ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2011-01-02 12:17 ` Florian Mickler 2011-01-08 22:42 ` Florian Mickler @ 2011-01-08 22:46 ` Jeff Mahoney 1 sibling, 0 replies; 11+ messages in thread From: Jeff Mahoney @ 2011-01-08 22:46 UTC (permalink / raw) To: Florian Mickler Cc: Dan Carpenter, Andrew Morton, David S. Miller, balbir, Linux Kernel Mailing List -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/02/2011 07:17 AM, Florian Mickler wrote: > On Sat, 1 Jan 2011 19:51:35 +0300 > Dan Carpenter <error27@gmail.com> wrote: > >> On Sat, Jan 01, 2011 at 05:19:46PM +0100, Florian Mickler wrote: >>> Is there already a patch available or integrated into iotop which >>> fixes this? I'd think that if the kernel could wait on fixed iotop's to >>> be distributed it would be easier to sell the breakage on bugzilla & >>> co... >>> >> >> The story is that 4be2c95d1f "taskstats: pad taskstats netlink response >> for aligment issues on ia64" broke iotop on 64 bit processors (32 bit >> was unaffected). This patch fixes it for x86-64 and powerpc-64. >> >> On the other 64 bit processors iotop works but instead you get a message >> in dmesg: >> kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 >> >> So on those arches you were already getting posts to bugzilla etc. Now >> those people can upgrade the kernel and download iotop version 0.4.2 or >> higher. >> >> regards, >> dan carpenter >> > > Ah ok. And probably bug #24272 is related to this. If I > understood it correctly 85893120 fixed some runtime warnings (or more > exactly the misaligning) and broke iotop in the process (on all of 64 > bit). > > 4be2c95d1f undid that and enhanced the netlink messages on IA64 > archs with a new type to fix the alignment and now it's changed to > align well on all archs that need alignment, leaving archs unbroken that > have efficient unaligned access (x86-64 and powerpc-64). Nice. > > And to answer my original question, i just checked out (some?/the?) > iotop sources from git://repo.or.cz/iotop.git and found a fix[1] for the > issue with 85893120. > > Is iotop parsing fixed to ignore the null-field in the meantime? It isn't yet, but I sent Guillaume a patch to iotop when I sent in the null-field patch that actually parses the packet instead of doing field-offset tricks. - -Jeff > Thx, > Flo > > [1]git://repo.or.cz/iotop.git:commit 08211d209ae8fc7e67ea3bebb09979ff61c70f97 > Author: Guillaume Chazarain <guichaz@gmail.com> > Date: Sat Sep 4 13:57:43 2010 +0200 > > Instead of assuming the pid field is 4 bytes long, take its length from the header. > This is needed for http://lkml.org/lkml/2010/2/12/167 > [PATCH] delayacct: align to 8 byte boundary on 64-bit systems - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0o6UUACgkQLPWxlyuTD7Is/wCfTUBE/2hg19vfGO2Wzk3Zkguo mW8AnAv6ey78E7dJsvkKLy/YS6vW10cE =fUIp -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] taskstats: Use better ifdef for alignment 2010-12-30 0:12 [PATCH] taskstats: Use better ifdef for alignment Jeff Mahoney 2010-12-30 0:14 ` Andrew Morton @ 2010-12-31 0:23 ` David Miller 1 sibling, 0 replies; 11+ messages in thread From: David Miller @ 2010-12-31 0:23 UTC (permalink / raw) To: jeffm; +Cc: akpm, error27, balbir, linux-kernel From: Jeff Mahoney <jeffm@suse.com> Date: Wed, 29 Dec 2010 19:12:08 -0500 > Commit 4be2c95d added a null field to align the taskstats structure but > the discussion centered around ia64. The issue exists on other platforms > with inefficient unaligned access and adding them piecemeal would be > an unmaintainable mess. > > This patch uses Dave Miller's suggestion of using a combination of > CONFIG_64BIT && !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS to determine > whether alignment is needed. > > Note that this will cause breakage on those platforms with applications > like iotop which had hard-coded offsets into the packet to access the > taskstats structure. > > The message seen on systems without the alignment fixes looks like: > kernel unaligned access to 0xe000023879dca9bc, ip=0xa000000100133d10 > > The addresses may vary but resolve to locations inside __delayacct_add_tsk. > > Reported-by: David S. Miller <davem@davemloft.net> > Signed-off-by: Jeff Mahoney <jeffm@suse.com> Acked-by: David S. Miller <davem@davemloft.net> ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-01-08 22:46 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-12-30 0:12 [PATCH] taskstats: Use better ifdef for alignment Jeff Mahoney 2010-12-30 0:14 ` Andrew Morton 2010-12-30 5:26 ` Jeff Mahoney 2010-12-30 5:32 ` Andrew Morton 2010-12-30 15:52 ` Jeff Mahoney 2011-01-01 16:19 ` Florian Mickler 2011-01-01 16:51 ` Dan Carpenter 2011-01-02 12:17 ` Florian Mickler 2011-01-08 22:42 ` Florian Mickler 2011-01-08 22:46 ` Jeff Mahoney 2010-12-31 0:23 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox