From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B06A3C4727E for ; Wed, 30 Sep 2020 11:26:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 78D8920708 for ; Wed, 30 Sep 2020 11:26:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="lvPu9S9z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78D8920708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 93C176B005C; Wed, 30 Sep 2020 07:26:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8ECF66B005D; Wed, 30 Sep 2020 07:26:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B4C66B0068; Wed, 30 Sep 2020 07:26:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 661DC6B005C for ; Wed, 30 Sep 2020 07:26:23 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 12BDB8249980 for ; Wed, 30 Sep 2020 11:26:23 +0000 (UTC) X-FDA: 77319499446.24.gold68_180198627192 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id EFDC91A4A5 for ; Wed, 30 Sep 2020 11:26:22 +0000 (UTC) X-HE-Tag: gold68_180198627192 X-Filterd-Recvd-Size: 6657 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 11:26:22 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UBKEEi114043; Wed, 30 Sep 2020 07:26:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id; s=pp1; bh=ieUdWiK6NEVNBPvTltm8/Mc89ypf0pulAoJ66Jpj2Nk=; b=lvPu9S9zOtu9iA3DoCeCQ1h1qgPDGlaFeyFcMEnJENBcm42tmCHMI8Uf8/4sL909rCZj XFZsSIVMC/+UYQviehCpUK7IHU7lB8Jo2d57D74rqWUK5Bzyj5+XIMRIQMevlpGsC17+ OnUGF3ZytrP5PuE++xy8ZO5TQ+qySPPiOk61XbhMl4KRAUGN8hbwgTFbZaqKhSzdZP21 VQSQdsOKMf+tLI1XwFLlc6UuNJwXwxcr/92dPeNmw/2or7BwdgDrgCS50WeluNejlacP EKbQOLmMQALd9bkFGllhIb8wjYL4a7qRJ2PrgpUbAY3fnfj4iByoKpM/yFn0iYoWpNQ+ kg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vs29r3ba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 07:26:19 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UBKQgN114689; Wed, 30 Sep 2020 07:26:18 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vs29r3as-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 07:26:18 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08UBI9FM006304; Wed, 30 Sep 2020 11:26:17 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 33v6mgrwfc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:26:17 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UBQEAN23658974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 11:26:14 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD8FB11C058; Wed, 30 Sep 2020 11:26:14 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAE7D11C054; Wed, 30 Sep 2020 11:26:14 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 30 Sep 2020 11:26:14 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 66E61E1FB0; Wed, 30 Sep 2020 13:26:14 +0200 (CEST) From: Eric Farman To: Vlastimil Babka Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Kees Cook , linux-mm@kvack.org, Eric Farman Subject: [PATCH 0/1] Fix slub_debug on 5.9-rc Date: Wed, 30 Sep 2020 13:26:11 +0200 Message-Id: <20200930112612.76109-1-farman@linux.ibm.com> X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-30_06:2020-09-30,2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 mlxlogscore=893 mlxscore=0 malwarescore=0 clxscore=1011 priorityscore=1501 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300084 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: Hi Vlastimil, et al, Apologies in advance, for I am way out of my element at the moment. I wanted to use slub_debug for a problem I'm looking at, and since the slab in question is always the same I added this: slub_debug=FZ,dma-kmalloc-8 But then my system just crashes on bringup (using the 5.9 RCs): [ 6.712339] Unable to handle kernel pointer dereference in virtual kernel address space [ 6.712344] Failing address: 0000004400000000 TEID: 0000004400000803 [ 6.712346] Fault in home space mode while using kernel ASCE. [ 6.712351] AS:00000000221ec007 R3:0000000000000024 [ 6.712406] Oops: 003b ilc:3 [#1] SMP [ 6.712410] Modules linked in: pkey zcrypt rng_core [ 6.712415] CPU: 6 PID: 8 Comm: kworker/u564:0 Not tainted 5.9.0-rc7 #4 [ 6.712418] Hardware name: IBM 2964 NE1 749 (LPAR) The same option works fine on 5.8, so I bisected mm/ and ended up blaming commit e17f1dfba37b ("mm, slub: extend slub_debug syntax for multiple blocks"). I didn't bother reverting this from 5.9, because of the neighboring rework that this was a part of, but I did apply it to 5.8, and recreated the problem there. Looking at the above commit, I note that kmem_cache_flags() now returns slub_debug instead of flags, which leads every kmem_cache (other than one I'm trying to debug) getting its flags set to zero. That wasn't the case previously, and seems quite suspect: [ 0.709206] s->name=dma-kmalloc-96 flags=4000 s->flags=0 [ 0.709227] s->name=dma-kmalloc-192 flags=4000 s->flags=0 [ 0.709248] s->name=dma-kmalloc-8 flags=4000 s->flags=4500 [ 0.709269] s->name=dma-kmalloc-16 flags=4000 s->flags=0 [ 0.709290] s->name=dma-kmalloc-32 flags=4000 s->flags=0 If I change my slab_list to "dma-kmalloc-*", and all dma slabs get assigned the debug flags in addition to DMA, the panic seen on boot disappears and my system comes up. I didn't leave my system up long enoughu to see if weirdness on the other slabs occurred, but I suspect it would. I am running on s390, with defconfig, but I don't think that matters here. Either way, the attached patch restores the variable that this routine returns for slabs not affected by slub_debug, and lets my system boot with various combinations of slub_debug parameters that I've tried. Hopefully it's close to what is needed here. I look forward to hearing your thoughts on this, and am happy to try other things if I'm too far into the weeds. Thanks! Eric Farman (1): mm, slub: Restore initial kmem_cache flags mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1