public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Rogers <brian@xyzw.org>
To: Jeff Mahoney <jeffm@suse.com>
Cc: balbir@linux.vnet.ibm.com, Dan Carpenter <error27@gmail.com>,
	linux-kernel@vger.kernel.org,
	Guillaume Chazarain <guichaz@gmail.com>
Subject: Re: delayacct: alignment changes break iotop
Date: Mon, 13 Dec 2010 12:56:09 -0800	[thread overview]
Message-ID: <4D068869.7040305@xyzw.org> (raw)
In-Reply-To: <4D0639B2.4060903@suse.com>

On 12/13/2010 07:20 AM, Jeff Mahoney wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/13/2010 07:57 AM, Balbir Singh wrote:
>> * Dan Carpenter<error27@gmail.com>  [2010-12-13 14:37:45]:
>>
>>> Iotop uses hardcoded offsets to find the taskstats struct members.
>>> This got changed in 2.6.37 so it now iotop doesn't work on amd64.  The
>>> offending commit is:
>>>
>>> commit 85893120699f8bae8caa12a8ee18ab5fceac978e
>>> Author: Jeff Mahoney<jeffm@suse.com>
>>> Date:   Wed Oct 27 15:34:43 2010 -0700
>>>
>>>      delayacct: align to 8 byte boundary on 64-bit systems
>>>
>>> Brian Rogers gets the reported-by tag.  The bugzilla entry is:
>>> https://bugzilla.kernel.org/show_bug.cgi?id=24272
>>>
>> Thanks for the report, looks like the change did not even bump the
>> version field. Sorry, its my fault, I should have caught it earlier.
>> iotop hard coding member offsets is not bad as long as we don't break
>> ABI (expected from us). Any chance you could dump the offsets before
>> and after the change?
> In your February response and again in September, you did suggest a
> version bump. I'm not sure why that didn't get integrated but I still
> don't see how it's necessary for code that actually follows the interface.
>
> iotop doesn't. It's broken. It doesn't even honor that version field and
> worse yet, it doesn't even honor the packet format which specifically
> doesn't define hard offsets. Rather it defines a protocol that tags
> fields and supplies the offsets in the packet.
>
> The getdelays.c code that ships with the kernel even demonstrates this,
> so there's no excuse for half-assing it like this.

 From a cursory glance, it looks to me like iotop (mostly) does the 
correct thing. The taskstats struct is received as one big chunk, so the 
table of fixed offsets (within struct taskstats) is necessary.

There's a bug fix in the git repo that fixes the cause of misalignment:

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


With this version of iotop, there is no problem with the latest kernel. 
I'm CCing the iotop author. It would be nice to have a release with this 
fix.

Brian


  reply	other threads:[~2010-12-13 21:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13 11:37 delayacct: alignment changes break iotop Dan Carpenter
2010-12-13 12:57 ` Balbir Singh
2010-12-13 13:10   ` Dan Carpenter
2010-12-13 15:20   ` Jeff Mahoney
2010-12-13 20:56     ` Brian Rogers [this message]
2010-12-13 21:22       ` Dan Carpenter
2010-12-14  7:02         ` [patch] delayacct: fix iotop on x86_64 Dan Carpenter
2010-12-14  8:02           ` Balbir Singh
2010-12-14  8:16             ` Dan Carpenter
2010-12-14 20:16             ` Andrew Morton
2010-12-14 20:21               ` Jeff Mahoney
2010-12-15  7:10               ` Balbir Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D068869.7040305@xyzw.org \
    --to=brian@xyzw.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=error27@gmail.com \
    --cc=guichaz@gmail.com \
    --cc=jeffm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox