From patchwork Wed Sep 30 11:26:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Farman X-Patchwork-Id: 11808851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4456C112E 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 9A0122076E 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 9A0122076E 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8ECF66B005D; Wed, 30 Sep 2020 07:26:23 -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 7B4C66B0068; Wed, 30 Sep 2020 07:26:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org 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-Spam-Summary: 1,0,0,4dedfc21ae19266c,d41d8cd98f00b204,farman@linux.ibm.com,,RULES_HIT:41:355:379:541:973:988:989:1260:1261:1345:1437:1535:1542:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3354:3622:3834:3865:3866:3867:3868:3870:3871:3872:3874:4117:4321:4559:5007:6119:6238:6261:6653:7903:9040:9163:9165:10004:10394:11026:11658:11914:12296:12297:12517:12519:12555:12663:12742:12895:12986:13161:13229:13618:13870:14096:14180:14394:14721:21060:21067:21080:21324:21433:21451:21627:21740:21789:21939:21990:30003:30029:30041:30054:30056:30069:30070,0,RBL:148.163.158.5:@linux.ibm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04y8en9um55pu7wzdaezg3psdnqpjoc1msy5gomsae6xyhisnry6dtzy1btjhuq.w77sbm3ay6qsxgfb9no54ahj6yguyd4c5b3ff3aqjng39kj3ii99z8fzsmresgb.o-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none 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(-)