Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp559406imu; Tue, 27 Nov 2018 02:58:05 -0800 (PST) X-Google-Smtp-Source: AJdET5ccqjmaVSqir+ClPk+Vrs0uywsDdfCgq2QXBAj3kvb62527N5am6qt7gqUAKVi1q6vu3VTn X-Received: by 2002:a62:d0c1:: with SMTP id p184mr31977887pfg.245.1543316285152; Tue, 27 Nov 2018 02:58:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543316285; cv=none; d=google.com; s=arc-20160816; b=njcpaFcfibaSCnNcEfCh92yjSRTbGgP1YtlbeyMgxIQhkl5vtAao6NAe6GtaqPDqDS W/0qVGWqnMZP662fnseejL6iEj1KeAKvmxgA3R1zsw7M55bQT/ZlklrwQ22WntwLVlN+ Wsia4WzlZtJX9add+TiGqnFkis3QkMxCbx1F7ViWG8yl3q7Bo9JLJULxt0WxVgMI5Ahh tA1BbmAykw0Mf/fTDC5tjb9fNXn/ExuLChxGofTJjlHhDrcP1u/sWLNlMXFj/ciYG8As RLxZDjLY+9GInJuOC27QNZQwHEdhesg5eQKbvS7ambacyQDEt5bzPE5MAHkUtcfIFTi7 uy5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=epFiVLwqCp/R4eBuKQfBRJX+WiG/Ul2Rk0nvnuDdVkE=; b=vySQX34YiSZtGj24dnSc/knuxJ3Qk1PgC8fZH3/2dEEYSdVA58mCxUztYk4RhToqVW Db9fo3WbT4UxTsbddIYr72aq8GsLaW7GSOllFAcv8l/qWw+uFEeC5o55JMFRcTCCezI4 43HT7nnnd8cW/PaRL2+JL7g4/L98MUslyZI9MBR4I9L9sXJOpxGgpCsuSIAhyE8eSiiL yfDE6huX6SLyTaborYTR+K0TKgVjYBAATy/C0VYlP5MSkxJK1q7bPsNgvAX8Hz2wR5fI ynOrPP1oXu3ZiWzUHxoTaNv1Dxk4g4L9XzshFE2gZfSvwzBMazw5Dl1zB4Kl4XZd+xmU ieww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="1hLvqlF/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18si3500586pgo.9.2018.11.27.02.57.50; Tue, 27 Nov 2018 02:58:05 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="1hLvqlF/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbeK0TCY (ORCPT + 99 others); Tue, 27 Nov 2018 14:02:24 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38621 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728838AbeK0TCX (ORCPT ); Tue, 27 Nov 2018 14:02:23 -0500 Received: by mail-pg1-f195.google.com with SMTP id g189so7498471pgc.5 for ; Tue, 27 Nov 2018 00:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=epFiVLwqCp/R4eBuKQfBRJX+WiG/Ul2Rk0nvnuDdVkE=; b=1hLvqlF/dPJQQfe8oIX/JXTjigWqI5Fc8ZNwYETuYRPnKF4ysgv6Ss11LREJblL1pG 3JbxSnhFj4P6lhyYPoG1uVZc8NTpvwFH+GavS9xhmR15sK3HXra76ZpWuOxhJz5tT2AR AXMdwiLmQSrC6f3zvgsBzF7LIUTHp5fxDOMgxXMnLif8AEH9xdnIjvZgumz3VBkrEVmw yvKh4NPgiOxLjagYnXd/Yv0uEiPg150GtjqFWW9XYlwPs7ThtpYpifle72y7Q2xisyFq jgsQSQzxUrI0zv4gJW1r9cfLBtJw+7iGOyH1N/+32COuKLFYCL10cWwNpoEu+jIdSCzQ nzOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=epFiVLwqCp/R4eBuKQfBRJX+WiG/Ul2Rk0nvnuDdVkE=; b=sRGZ7SQ5xCv83BI8/JwvyI/Vh/UPqB8kDzZtmhlqzlBHpoAU6uDfngcSqBQbWfT0hw tY6Jj7HcZ8VfuGNDZiZEyyg4+nr5fh9VrTlLhgeqMms/75bZENiEX3dLjatW9FWD7R8c Sf0H9q17BqFe9J5x44eOzxfoZhVagKBy4iY6qrDRrPz4MKM4H14biJNXDPZUDDb5fP5b P6E7jO/ulNRR7KiA4Bh6Q4FPiuoRFLlTQiWisTGviAwzJ6itPkVPKUAfQlLVI3WYrxem kWqsC7UFD+Vf0hJ5fZn/iOZjmmHvRkM79zIpagF1UkAGhAruvwUa+KGW0JZxrimk9I6K x6QQ== X-Gm-Message-State: AGRZ1gIvHl732lwKYSaVbocsbcvE896A6E+DTCt+/OZDvuoMJrQwNV2U BcvsYx6140mTScLK1h68W8AYfg== X-Received: by 2002:a62:6408:: with SMTP id y8mr31692690pfb.202.1543305920097; Tue, 27 Nov 2018 00:05:20 -0800 (PST) Received: from kshutemo-mobl1.localdomain (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by smtp.gmail.com with ESMTPSA id b7sm3492586pfa.52.2018.11.27.00.05.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 00:05:19 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id 99CC63003AF; Tue, 27 Nov 2018 11:05:15 +0300 (+03) Date: Tue, 27 Nov 2018 11:05:15 +0300 From: "Kirill A. Shutemov" To: Heiko Carstens Cc: "Kirill A. Shutemov" , Li Wang , Guenter Roeck , Janosch Frank , linux-kernel , Linux-MM , Martin Schwidefsky Subject: Re: [PATCH 3/3] s390/mm: fix mis-accounting of pgtable_bytes Message-ID: <20181127080515.py6naga4gsi2yad2@kshutemo-mobl1> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127073411.GA3625@osiris> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 08:34:12AM +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 > > Besides that this needs to be fixed, I'd really like to see this > changed to either a printk_once() or a WARN_ON_ONCE() within > check_mm() so that an arbitrary user cannot flood the console. > > E.g. something like the below. If there aren't any objections, I will > provide a proper patch with changelog, etc. > > diff --git a/kernel/fork.c b/kernel/fork.c > index 07cddff89c7b..d7aeec03c57f 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -647,8 +647,8 @@ static void check_mm(struct mm_struct *mm) > } > > if (mm_pgtables_bytes(mm)) > - pr_alert("BUG: non-zero pgtables_bytes on freeing mm: %ld\n", > - mm_pgtables_bytes(mm)); > + printk_once(KERN_ALERT "BUG: non-zero pgtables_bytes on freeing mm: %ld\n", > + mm_pgtables_bytes(mm)); You can be the first user of pr_alert_once(). Don't miss a chance! ;) -- Kirill A. Shutemov