From: Jeff Mahoney <jeffm@suse.com>
To: Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>,
Dan Carpenter <error27@gmail.com>,
balbir@linux.vnet.ibm.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] taskstats: Use better ifdef for alignment
Date: Wed, 29 Dec 2010 19:12:08 -0500 [thread overview]
Message-ID: <4D1BCE58.4000902@suse.com> (raw)
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
next reply other threads:[~2010-12-30 0:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-30 0:12 Jeff Mahoney [this message]
2010-12-30 0:14 ` [PATCH] taskstats: Use better ifdef for alignment 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
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=4D1BCE58.4000902@suse.com \
--to=jeffm@suse.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=error27@gmail.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