linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: linux-mm@kvack.org, sparclinux@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH v3 1/4] sparc64: NG4 memset 32 bits overflow
Date: Fri, 3 Mar 2017 15:34:03 -0800	[thread overview]
Message-ID: <20170303153403.182c7088b14fa8401b9cf8b3@linux-foundation.org> (raw)
In-Reply-To: <1488432825-92126-2-git-send-email-pasha.tatashin@oracle.com>

On Thu,  2 Mar 2017 00:33:42 -0500 Pavel Tatashin <pasha.tatashin@oracle.com> wrote:

> Early in boot Linux patches memset and memcpy to branch to platform
> optimized versions of these routines. The NG4 (Niagra 4) versions are
> currently used on  all platforms starting from T4. Recently, there were M7
> optimized routines added into UEK4 but not into mainline yet. So, even with
> M7 optimized routines NG4 are still going to be used on T4, T5, M5, and M6
> processors.
> 
> While investigating how to improve initialization time of dentry_hashtable
> which is 8G long on M6 ldom with 7T of main memory, I noticed that memset()
> does not reset all the memory in this array, after studying the code, I
> realized that NG4memset() branches use %icc register instead of %xcc to
> check compare, so if value of length is over 32-bit long, which is true for
> 8G array, these routines fail to work properly.
> 
> The fix is to replace all %icc with %xcc in these routines. (Alternative is
> to use %ncc, but this is misleading, as the code already has sparcv9 only
> instructions, and cannot be compiled on 32-bit).
> 
> This is important to fix this bug, because even older T4-4 can have 2T of
> memory, and there are large memory proportional data structures in kernel
> which can be larger than 4G in size. The failing of memset() is silent and
> corruption is hard to detect.
> 
> Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
> Reviewed-by: Babu Moger <babu.moger@oracle.com>

It sounds like this fix should be backported into -stable kernels?  If
so, which version(s)?

Also, what are the user-visible runtime effects of this change?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-03-03 23:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  5:33 [PATCH v3 0/4] Zeroing hash tables in allocator Pavel Tatashin
2017-03-02  5:33 ` [PATCH v3 1/4] sparc64: NG4 memset 32 bits overflow Pavel Tatashin
2017-03-03 23:34   ` Andrew Morton [this message]
2017-03-02  5:33 ` [PATCH v3 2/4] mm: Zeroing hash tables in allocator Pavel Tatashin
2017-03-02  5:33 ` [PATCH v3 3/4] mm: Updated callers to use HASH_ZERO flag Pavel Tatashin
2017-03-02  5:33 ` [PATCH v3 4/4] mm: Adaptive hash table scaling Pavel Tatashin
2017-03-03 23:32   ` Andrew Morton
2017-04-26 20:11     ` Michal Hocko
2017-05-02  8:04       ` Michal Hocko
2017-05-04 18:23       ` Pasha Tatashin
2017-05-04 18:28         ` Pasha Tatashin
2017-05-05 13:30           ` Michal Hocko
2017-05-05 15:33             ` Pasha Tatashin
2017-05-09  9:46               ` Michal Hocko
2017-05-09 13:07                 ` Pasha Tatashin
2017-05-05 13:29         ` Michal Hocko
2017-05-17 15:51     ` Pasha Tatashin

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=20170303153403.182c7088b14fa8401b9cf8b3@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@oracle.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).