Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp809687imu; Tue, 27 Nov 2018 06:38:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/VqZuy2Ui0/f/iGBOgDMCFa+u31C+DeP2t8yw51mgFf4F5ajjjV1TT2lhex7qO3nbMJgeP8 X-Received: by 2002:a17:902:bf03:: with SMTP id bi3mr31142885plb.83.1543329489169; Tue, 27 Nov 2018 06:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543329489; cv=none; d=google.com; s=arc-20160816; b=OeGNoGmLms/hvv6IQ6+3zMXY60m2+Y9YseZCQ46JV/ahECKVlFo90Ve+/Y4BMGgoe9 tgacVnvU/KS9K9ls6VM14IKNb2Go3FQK1FObOY1zqGgecbzzszARZfOrqdcew+8NunQp 6gylhB4Xr2vD3xvsT0A7Y+zpgdRzF1GeeNrl0k9Txu7GI8qQp2om40q7HJ6DRttM4SRI IviGU3ixQZez8CqPIp4aUGYbGZWOCkQNbiucZ8Vc5pWtnw2MIsHSp/V1GOYuqzlNJHku m28xssCKjGJ/tNOsJqxE1qf13j90xymIpIWYg+f4DB3FycIKDE/RbmI062KVexK2Rjek 1ukg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=545/YWIm4HaKjbSZk5bsFmtjv+Snx29OF9kKk3FsxyQ=; b=WI8C/jmg6gcF1qU9NJWIHH8csbqutuZDhg3yXbUXcN/s8hgjqjudencYdmJZVeeRiE LrCJkILWtz1NyemKBq9bhYDAjNg8PZj1uI+G2wsfquJbF0jFhTdvpJ6l2ySyRgM8Pnw8 4WNqWBe+7CeYF1eCaKqmO/768wzWseaEIirEyXA5ha2oVr9lIspkI3kBNtwWUCc6MUKP Zk3LqG6QRb4ACMjEX99UpdXlQkjtUMVhHcn/8TmeBnEjxRM7xAs+ERRsHCtowemxvK89 5nrQu4nd9xvSDHZ5M2Z+dvV2QXDo85R9OHEzRc+qcvXWWIlrG8gALM0ydBBLxM1p4TdW ufpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34-v6si4192402pld.249.2018.11.27.06.37.27; Tue, 27 Nov 2018 06:38:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbeK1B33 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 27 Nov 2018 20:29:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51310 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726346AbeK1B32 (ORCPT ); Tue, 27 Nov 2018 20:29:28 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAREU5eL131760 for ; Tue, 27 Nov 2018 09:31:21 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p15q15j0k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 27 Nov 2018 09:31:21 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Nov 2018 14:31:19 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 27 Nov 2018 14:31:16 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAREVFhX62980338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Nov 2018 14:31:16 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4B1F42042; Tue, 27 Nov 2018 14:31:15 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E0A74203F; Tue, 27 Nov 2018 14:31:15 +0000 (GMT) Received: from mschwideX1 (unknown [9.152.212.164]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 27 Nov 2018 14:31:15 +0000 (GMT) Date: Tue, 27 Nov 2018 15:31:14 +0100 From: Martin Schwidefsky To: Heiko Carstens Cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , Li Wang , Guenter Roeck , Janosch Frank , linux-kernel , Linux-MM Subject: Re: [PATCH 3/3] s390/mm: fix mis-accounting of pgtable_bytes In-Reply-To: <20181127073411.GA3625@osiris> References: <1539621759-5967-1-git-send-email-schwidefsky@de.ibm.com> <1539621759-5967-4-git-send-email-schwidefsky@de.ibm.com> <20181031073149.55ddc085@mschwideX1> <20181031100944.GA3546@osiris> <20181031103623.6ykzsjdenrpeth7x@kshutemo-mobl1> <20181127073411.GA3625@osiris> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112714-0028-0000-0000-000003223E25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112714-0029-0000-0000-000023DE470F Message-Id: <20181127153114.0a6193d3@mschwideX1> Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 8BIT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-27_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811270125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Nov 2018 08:34:12 +0100 Heiko Carstens wrote: > On Wed, Oct 31, 2018 at 01:36:23PM +0300, Kirill A. Shutemov wrote: > > On Wed, Oct 31, 2018 at 11:09:44AM +0100, Heiko Carstens wrote: > > > On Wed, Oct 31, 2018 at 07:31:49AM +0100, Martin Schwidefsky wrote: > > > > Thanks for testing. Unfortunately Heiko reported another issue yesterday > > > > with the patch applied. This time the other way around: > > > > > > > > BUG: non-zero pgtables_bytes on freeing mm: -16384 > > > > > > > > I am trying to understand how this can happen. For now I would like to > > > > keep the patch on hold in case they need another change. > > > > > > FWIW, Kirill: is there a reason why this "BUG:" output is done with > > > pr_alert() and not with VM_BUG_ON() or one of the WARN*() variants? > > > > > > That would to get more information with DEBUG_VM and / or > > > panic_on_warn=1 set. At least for automated testing it would be nice > > > to have such triggers. > > > > Stack trace is not helpful there. It will always show the exit path which > > is useless. > > So, even with the updated version of these patches I can flood dmesg > and the console with > > BUG: non-zero pgtables_bytes on freeing mm: 16384 > > messages with this complex reproducer on s390: > > echo "void main(void) {}" | gcc -m31 -xc -o compat - && ./compat Forgot a hunk in the fix.. I claim not enough coffee :-/ Patch is queued and I will send a please pull by the end of the week. -- From c0499f2aa853939984ecaf0d393012486e56c7ce Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Tue, 27 Nov 2018 14:04:04 +0100 Subject: [PATCH] s390/mm: correct pgtable_bytes on page table downgrade The downgrade of a page table from 3 levels to 2 levels for a 31-bit compat process removes a pmd table which has to be counted against pgtable_bytes. Signed-off-by: Martin Schwidefsky --- arch/s390/mm/pgalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index 814f26520aa2..6791562779ee 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c @@ -131,6 +131,7 @@ void crst_table_downgrade(struct mm_struct *mm) } pgd = mm->pgd; + mm_dec_nr_pmds(mm); mm->pgd = (pgd_t *) (pgd_val(*pgd) & _REGION_ENTRY_ORIGIN); mm->context.asce_limit = _REGION3_SIZE; mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH | -- 2.16.4 -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.