public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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