linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: linux-kernel@vger.kernel.org
Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, mroos@linux.ee, sparclinux@vger.kernel.org
Subject: Re: unaligned accesses in SLAB etc.
Date: Sun, 12 Oct 2014 13:20:12 -0400 (EDT)	[thread overview]
Message-ID: <20141012.132012.254712930139255731.davem@davemloft.net> (raw)
In-Reply-To: <20141011.221510.1574777235900788349.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Sat, 11 Oct 2014 22:15:10 -0400 (EDT)

> 
> I'm getting tons of the following on sparc64:
> 
> [603965.383447] Kernel unaligned access at TPC[546b58] free_block+0x98/0x1a0
> [603965.396987] Kernel unaligned access at TPC[546b60] free_block+0xa0/0x1a0
> [603965.410523] Kernel unaligned access at TPC[546b58] free_block+0x98/0x1a0

The unaligned accesses are happening in the SLAB_OBJ_PFMEMALLOC code,
which assumes that all object pointers are "unsigned long" aligned:

static inline void set_obj_pfmemalloc(void **objp)
{
        *objp = (void *)((unsigned long)*objp | SLAB_OBJ_PFMEMALLOC);
        return;
}

etc. etc.

But that code has been there working forever.  Something changed
recently such that this assumption no longer holds.

In all of the cases, the address is 4-byte aligned but not 8-byte
aligned.  And they are vmalloc addresses.

Which made me suspect the percpu commit:

====================
commit bf0dea23a9c094ae869a88bb694fbe966671bf6d
Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Date:   Thu Oct 9 15:26:27 2014 -0700

    mm/slab: use percpu allocator for cpu cache
====================

And indeed, reverting this commit fixes the problem.

  reply	other threads:[~2014-10-12 17:20 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-12  2:15 unaligned accesses in SLAB etc David Miller
2014-10-12 17:20 ` David Miller [this message]
2014-10-13 20:22   ` mroos
2014-10-13 23:52     ` Joonsoo Kim
2014-10-14  0:04       ` David Miller
2014-10-14  0:14         ` Joonsoo Kim
2014-10-14 21:19         ` mroos
2014-10-14 21:32           ` David Miller
2014-10-15  8:04             ` Meelis Roos
2014-10-15 18:36               ` David Miller
2014-10-15 20:11                 ` Meelis Roos
2014-10-16  3:11                   ` David Miller
2014-10-16  7:22                     ` Meelis Roos
2014-10-16 20:11                       ` Meelis Roos
2014-10-16 20:18                         ` David Miller
2014-10-16 21:38                     ` Meelis Roos
2014-10-19  4:32                       ` David Miller
2014-10-19  7:07                         ` Meelis Roos
2014-10-20 18:57                           ` David Miller
2014-10-22 20:39                             ` David Miller
2014-10-22 23:22                               ` Meelis Roos
2014-10-23 17:02                                 ` David Miller
2014-10-23 21:22                                   ` David Miller
2014-10-24  4:54                                     ` Sam Ravnborg
2014-10-24 16:53                                       ` David Miller
2014-10-24  7:49                                     ` Meelis Roos
2014-10-24 16:45                                       ` David Miller
2014-10-16  7:02             ` Meelis Roos
2014-10-16 20:07               ` David Miller
2014-10-16 20:16                 ` Meelis Roos
2014-10-16 20:20                   ` David Miller
2014-10-16 20:50                     ` David Miller
2014-10-17 11:12                       ` Meelis Roos
2014-10-18 17:59                         ` David Miller
2014-10-18 18:23                           ` David Miller
2014-10-19 12:31                             ` Meelis Roos
2014-10-19 17:12                               ` Meelis Roos
2014-10-19 17:18                                 ` David Miller
2014-10-19 15:32                             ` Sam Ravnborg
2014-10-19 17:27                               ` David Miller
2014-10-19 19:55                                 ` Sam Ravnborg
2014-10-16 20:20                 ` Meelis Roos
2014-10-16 20:40                   ` Meelis Roos
2014-10-12 17:22 ` Joonsoo Kim
2014-10-12 17:30   ` David Miller
2014-10-12 17:43     ` Joonsoo Kim

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=20141012.132012.254712930139255731.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mroos@linux.ee \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=sparclinux@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;
as well as URLs for NNTP newsgroup(s).