Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp226338imu; Tue, 27 Nov 2018 11:26:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fFL1rCK/NOhQL3e+emzNEI/sbCHfHE4j06jvf4Xu5jkixv26P6jIMuDsDx9lH5O2GqTP2v X-Received: by 2002:a62:130c:: with SMTP id b12mr34368865pfj.247.1543346780759; Tue, 27 Nov 2018 11:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543346780; cv=none; d=google.com; s=arc-20160816; b=S4PMUsCFRTaJzHwiZigG9wjy3/Yq0A6N1dxwozs2gnEttNXl5hoO4ZHSQD72P9CwWp KTs+rClySpBNKmySG9eRAh7HIByUn/j+0R6l5UPpBFk/37b1/BVdnepcqbCh21cqoAdV 2vfZeLMV1oUT6A+On0DR95Z06WdjR4KewcnSm15EbQY69N/qq1QDRL4rXwniddEgZq4D hVLQObk4pMuJJlfXauWI5fI2M0yEHTui9VhOK40mEjNvsZJe3i2ajpCvVLvVlaGUNJiZ FgwuUFOSj9ulXvcukGwavYg2hNyyjia5D4d34hVCW4/0X7gNl6tw83h6D26/zSqJnID0 LHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=wCl3OpK+JNMxgv3uFw+diZo+EoeUN/EKRtJ7Mf4YTxg=; b=xgjSbBzL47OHV7J36huXUZIVCNdVtLwefbAkS7BXU2KpzkIZWA4T3a7O8CmZzd5aDQ HiAEzYOJac1DuubzTsD5WVv1TgfPJ7JSw6GGz1jvtPDEF+/M/L9IO6x0Yh/VPHnCxx5j 1TtwrInIUCa0T81H//BEB4jy3T9/fDxYajFzF05qObJMkp2J1TQe2CU6z0QACzggQMqf FkLoOOgO4TJs97YeZz1dCUAx6flATwCCOIIzgEzGXHMo3aHDwMK/dp3uKhZmMBd5klza cyTpnbfhCaYWq3HTwX0d8zgN+XdyzUholElf2FX8pwfyqcxCtKAWFcG5cTP6doRITNKH qQzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=mJOpQA5Q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si5027185plm.1.2018.11.27.11.26.05; Tue, 27 Nov 2018 11:26:20 -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=@oracle.com header.s=corp-2018-07-02 header.b=mJOpQA5Q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729989AbeK1CyS (ORCPT + 99 others); Tue, 27 Nov 2018 21:54:18 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:35662 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbeK1CyS (ORCPT ); Tue, 27 Nov 2018 21:54:18 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wARFsfur073737; Tue, 27 Nov 2018 15:55:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=wCl3OpK+JNMxgv3uFw+diZo+EoeUN/EKRtJ7Mf4YTxg=; b=mJOpQA5QqtOaeqGLJCJhQXP8Cx17Jh33Kld2WuavXBb9kVJb9Ag55gnXMNatfOICrd5X sTkwbqogY0bWKTDO8iUZAVn0mJUaeQm9eSHmoFxcywoe4X9/fPbS19yPZbdDnd+8JTMc tt6T6MBU1sLlYQ5CxGdhVIlHZxHnyPJZb+9vPG+L003qYcDhOi47JuJVEhAkfW4qcBWo O+yxLvDIhwY6Y69iHxn3aWohxABxaIhor9SIqrMvRKz7t5ohLu6XWiDlCUStfLhGsCiy acjUdz6HUOWE+Qd09ketF5dlKpHVK9XIisaSRO+pN4zeaAA5T6P1v1dGnQmtOVdnFVxO Fg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2nxx2u4w8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Nov 2018 15:55:50 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wARFtnHc027557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Nov 2018 15:55:49 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wARFtnFw020401; Tue, 27 Nov 2018 15:55:49 GMT Received: from [192.168.0.110] (/73.243.10.6) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Nov 2018 07:55:49 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH] mm: warn only once if page table misaccounting is detected From: William Kucharski In-Reply-To: <20181127155213.GB27075@linux.intel.com> Date: Tue, 27 Nov 2018 08:55:47 -0700 Cc: Heiko Carstens , Andrew Morton , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-mm@kvack.org, "Kirill A . Shutemov" , Martin Schwidefsky Content-Transfer-Encoding: quoted-printable Message-Id: <0AD1CE43-3B5B-4D4B-963B-056D749F196E@oracle.com> References: <20181127083603.39041-1-heiko.carstens@de.ibm.com> <20181127155213.GB27075@linux.intel.com> To: Sean Christopherson X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9089 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811270137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 27, 2018, at 8:52 AM, Sean Christopherson = wrote: >=20 > On Tue, Nov 27, 2018 at 09:36:03AM +0100, Heiko Carstens wrote: >> Use pr_alert_once() instead of pr_alert() if page table misaccounting >> has been detected. >>=20 >> If this happens once it is very likely that there will be numerous >> other occurrence as well, which would flood dmesg and the console = with >> hardly any added information. Therefore print the warning only once. >>=20 >> Cc: Kirill A. Shutemov >> Cc: Martin Schwidefsky >> Signed-off-by: Heiko Carstens >> --- >> kernel/fork.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >>=20 >> diff --git a/kernel/fork.c b/kernel/fork.c >> index 07cddff89c7b..c887e9eba89f 100644 >> --- a/kernel/fork.c >> +++ b/kernel/fork.c >> @@ -647,8 +647,8 @@ static void check_mm(struct mm_struct *mm) >> } >>=20 >> if (mm_pgtables_bytes(mm)) >> - pr_alert("BUG: non-zero pgtables_bytes on freeing mm: = %ld\n", >> - mm_pgtables_bytes(mm)); >> + pr_alert_once("BUG: non-zero pgtables_bytes on freeing = mm: %ld\n", >> + mm_pgtables_bytes(mm)); >=20 > I found the print-always behavior to be useful when developing a = driver > that mucked with PTEs directly via vmf_insert_pfn() and had issues = with > racing against exit_mmap(). It was nice to be able to recompile only > the driver and rely on dmesg to let me know when I messed up yet = again. >=20 > Would pr_alert_ratelimited() suffice? Actually, I really like that idea. There are certainly times when it is useful to see a cascade of = messages, within reason; one there are so many they overflow the dmesg buffer they're of limited = usefulness. Something like a pr_alert() that could rate limit to a preset value, = perhaps a default of fifty or so, could prove quite useful indeed without being an all or = once choice. William Kucharski=