From patchwork Tue Apr 16 14:10:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 10903197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77DE814DB for ; Tue, 16 Apr 2019 14:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593C5289C7 for ; Tue, 16 Apr 2019 14:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B9D328A32; Tue, 16 Apr 2019 14:10:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB65E289C7 for ; Tue, 16 Apr 2019 14:10:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FAE76B029E; Tue, 16 Apr 2019 10:10:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9AAC06B02A0; Tue, 16 Apr 2019 10:10:38 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89A6A6B02A1; Tue, 16 Apr 2019 10:10:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id 39EF16B029E for ; Tue, 16 Apr 2019 10:10:38 -0400 (EDT) Received: by mail-wr1-f69.google.com with SMTP id t9so19115713wrs.16 for ; Tue, 16 Apr 2019 07:10:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:in-reply-to:message-id:references:user-agent :mime-version; bh=bcwtsG3AsTGo9tev0nV+FZQAPz0TKizWn2+evyQlQVQ=; b=QRwz/cGNeSBrFttXNPxyeIDXaZ4BKsE37gxlpt21gedaHJ99OaSbLgZuq7tc1UaTGa kyLxcFSsU/zr0Ex/bO+q6fnoqU68AXnXwOcdXAUNTrqsAmAJKt3asdM2R3mVsJJK7iR8 X7LBbe+Jd3ZiF9hakUbhrP+LnfN3eCrm+o8J1xdBNnWhyHs81NGERwjjUt1RzaxXNafB GqEgv5C72Xd8F14GphNX5R+omig0tuBRjUt7XODWPlaptHXzstUEIDNieOfyusf/5D47 ZsX3Q1GWox5GJht9ovP7qudpKxqSyxSPRVFcCy1lUvUj5ytV7e/eD0fh3xNQGUDg2wd6 r3AA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de X-Gm-Message-State: APjAAAV9xgGeIHA2x0yrLVfXwmw/27NnLk6jHDFoDARCfP4tK69MYpNe RimEyM3C6br8Fb2Yf6Wnq8nhmBENNrys2djr+rurqg+K7HTP9gwKM3mswO6ojTU3ii0SR5Q+wKA gtutuetmk2cttHWSU7R4UaaUikRqovOdiEV2Ku58mRBN4ak/OVmuZOqQ549Nj2ehvkA== X-Received: by 2002:adf:f80c:: with SMTP id s12mr44765564wrp.72.1555423837577; Tue, 16 Apr 2019 07:10:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzyEC+mcckMD/kK6vxg/zwzP2beOMq3NejC99jb8KJXsZVGUjq4PhBUJjN9qwa2z2s/Q/f X-Received: by 2002:adf:f80c:: with SMTP id s12mr44765478wrp.72.1555423836412; Tue, 16 Apr 2019 07:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555423836; cv=none; d=google.com; s=arc-20160816; b=ZODAogiSr4pKkKqNSZshvxheDU5FqgKgmZYY0moPsjF3GKBVBXXQQjAaoroH15WVeI tw9PJ6uwTM3BStVDh03DbDZUfNsD5o/uYmwScN81T6KzTHie9ZRuc/rbpZ8K4AVowDrN 6gvlOwBGvzrFnPuAa7TQoaYfYBD3a+qjFV5IRK3SAzHJXtEzQXJUovIy4XE/fNvLoLWx XISAUnC47yakha1f3mwHX7WHY5+S/7SqBMiPsTIG6R+0gv8MFodM89cAyMJ/fu8KdRfk 2x46L9T3jdVz7/sVTSl4enabwyGrYOCs/tVfO41ui6lZvuNf4jfvMEupT88BVz5ise5+ Z0UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date; bh=bcwtsG3AsTGo9tev0nV+FZQAPz0TKizWn2+evyQlQVQ=; b=0x/iXrnbjui/Rtn/+/gsdYqVm9bXkiKoWUZH3cXvY803JlCZ6YaeYxP9lZRIoZWMAD ePk2F8X6keV+1RgaM3pDpK6Zhj+Xvi5Ly25eg7b+wYZfLOiD1202e/QmEkDZSOQlf404 06XLhR+KzUfNPkCuvhXq0wmYl5IiRoRQXXUdFcpCb/4/A2JeY+qBegqMqZmVuMb0oDyv K8wsxjIGNtNZH4kOeackY3xee42fqVJkKNJFSuYDZINJR8gOJJDBtPIPwA8EDOhMmxsx pm5vCxlkNczxoQyjSPd6PKztiqrEfVxU9++M+vqu1ivWx3Atwbxg+SgURQIVvr0zUztk KWhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id j19si12808418wmh.46.2019.04.16.07.10.36 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 16 Apr 2019 07:10:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) client-ip=2a01:7a0:2:106d:700::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tglx@linutronix.de designates 2a01:7a0:2:106d:700::1 as permitted sender) smtp.mailfrom=tglx@linutronix.de Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hGOn3-00036D-Gl; Tue, 16 Apr 2019 16:10:25 +0200 Date: Tue, 16 Apr 2019 16:10:25 +0200 (CEST) From: Thomas Gleixner To: Vlastimil Babka cc: Andy Lutomirski , Josh Poimboeuf , LKML , X86 ML , Sean Christopherson , Andrew Morton , Pekka Enberg , Linux-MM , David Rientjes Subject: [patch V5 01/32] mm/slab: Remove broken stack trace storage In-Reply-To: <612f9b99-a75b-6aeb-cf92-7dc5421cd950@suse.cz> Message-ID: References: <20190414155936.679808307@linutronix.de> <20190414160143.591255977@linutronix.de> <20190415132339.wiqyzygqklliyml7@treble> <20190415161657.2zwboghblj5ducux@treble> <612f9b99-a75b-6aeb-cf92-7dc5421cd950@suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP kstack_end() is broken on interrupt stacks as they are not guaranteed to be sized THREAD_SIZE and THREAD_SIZE aligned. As SLAB seems not to be used much with debugging enabled and might just go away completely according to: https://lkml.kernel.org/r/612f9b99-a75b-6aeb-cf92-7dc5421cd950@suse.cz just remove the bogus code instead of trying to fix it. Fixes: 98eb235b7feb ("[PATCH] page unmapping debug") - History tree Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: Pekka Enberg Cc: linux-mm@kvack.org Acked-by: Vlastimil Babka --- V5: Remove the cruft. V4: Make it actually work V2: Made the code simpler to understand (Andy) --- mm/slab.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) --- a/mm/slab.c +++ b/mm/slab.c @@ -1470,33 +1470,17 @@ static bool is_debug_pagealloc_cache(str static void store_stackinfo(struct kmem_cache *cachep, unsigned long *addr, unsigned long caller) { - int size = cachep->object_size; + int size = cachep->object_size / sizeof(unsigned long); addr = (unsigned long *)&((char *)addr)[obj_offset(cachep)]; - if (size < 5 * sizeof(unsigned long)) + if (size < 4) return; *addr++ = 0x12345678; *addr++ = caller; *addr++ = smp_processor_id(); - size -= 3 * sizeof(unsigned long); - { - unsigned long *sptr = &caller; - unsigned long svalue; - - while (!kstack_end(sptr)) { - svalue = *sptr++; - if (kernel_text_address(svalue)) { - *addr++ = svalue; - size -= sizeof(unsigned long); - if (size <= sizeof(unsigned long)) - break; - } - } - - } - *addr++ = 0x87654321; + *addr = 0x87654321; } static void slab_kernel_map(struct kmem_cache *cachep, void *objp,