Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6612265ybi; Wed, 31 Jul 2019 18:01:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvB4FiD7MrEt1arxnmIKv9TcVEuyNtwe9fSKf0TSPyoMtyoHv72+FVpmA2Bm4E0onHn+U9 X-Received: by 2002:a17:90a:bf08:: with SMTP id c8mr5660038pjs.75.1564621283396; Wed, 31 Jul 2019 18:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564621283; cv=none; d=google.com; s=arc-20160816; b=Y32ldIPMXVBKmKJJ71y/B8f55PeZiI6TDsLafymN5ZW2FdL2CUhYBvHToDfJC9eyKI r9RfeONjSg0CPePdg6RZxQEBD5OInNNzUwtRPLPnheYnh13f5LFsoRXJDTmGhK/kCgSa DUBZ/nKkK/vz3P3hAqLlV+ooLD0EU2cp/o8mR/1vIIKr8z5T6JklKxX9mcxZR+z3+zFo 0ma37Ad+4srYA0HglQcb1/Ehz801T3hu7Jl4Bevec0Ky8UhWg8b97vxl2UxPOMbr6z1F w8E0E/gmiC8gDb085AmxEQwkgiKB7rFeprqH8ZjLeXXPxAt//O6gvk2EEtnWcWbC+huY Wcow== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=0bWlLBuUofOMXxzWXPVmkrlWbXYAAypOrTSLVPR2loI=; b=bLhFQpEoL88QQLkA4cMqIsC0LZu2Yffgd6hyCxgweSJJxArmLmtEGtN1++K6WKbgOu c5EjQrVJbGwpxrR+G2p+axWW1/300oEHEJ1gHFnFsFIw92ndWluMxaZP4XjTByZomQ8D 0lvZTdOF+as59cYu6k5BFC/IKImt47Plu/64DSRy7rId65CZZdiz+qG7dFRWsWp5un8J ZLLuX4Bjf+0W3ps+IzkA6Ik5/U57RC1VsAKprlieKDMuXEK6CI+gfdUwBFt2JBd2cIMi qqtqAgHvr0kUv8XeVjbftjyDRV3JZJtyH8nrClS8CqhIaHqfrOD32bC6Wh+lvy25nJrq I48w== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si36510885pfe.140.2019.07.31.18.01.08; Wed, 31 Jul 2019 18:01:23 -0700 (PDT) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728582AbfGaWkH (ORCPT + 99 others); Wed, 31 Jul 2019 18:40:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:36651 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbfGaWkH (ORCPT ); Wed, 31 Jul 2019 18:40:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 15:40:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,331,1559545200"; d="scan'208";a="191399007" Received: from sai-dev-mach.sc.intel.com ([143.183.140.153]) by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2019 15:40:07 -0700 Message-ID: Subject: Re: [PATCH] fork: Improve error message for corrupted page tables From: Sai Praneeth Prakhya To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, dave.hansen@intel.com, Ingo Molnar , Peter Zijlstra Date: Wed, 31 Jul 2019 15:36:49 -0700 In-Reply-To: <20190731152753.b17d9c4418f4bf6815a27ad8@linux-foundation.org> References: <20190730221820.7738-1-sai.praneeth.prakhya@intel.com> <20190731152753.b17d9c4418f4bf6815a27ad8@linux-foundation.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > With patch: > > ----------- > > [ 69.815453] mm/pgtable-generic.c:29: bad p4d > > 0000000084653642(800000025ca37467) > > [ 69.815872] BUG: Bad rss-counter state mm:00000000014a6c03 > > type:MM_FILEPAGES val:2 > > [ 69.815962] BUG: Bad rss-counter state mm:00000000014a6c03 > > type:MM_ANONPAGES val:5 > > [ 69.816050] BUG: non-zero pgtables_bytes on freeing mm: 20480 > > Seems useful. > > > --- a/include/linux/mm_types_task.h > > +++ b/include/linux/mm_types_task.h > > @@ -44,6 +44,13 @@ enum { > > NR_MM_COUNTERS > > }; > > > > +static const char * const resident_page_types[NR_MM_COUNTERS] = { > > + "MM_FILEPAGES", > > + "MM_ANONPAGES", > > + "MM_SWAPENTS", > > + "MM_SHMEMPAGES", > > +}; > > But please let's not put this in a header file. We're asking the > compiler to put a copy of all of this into every compilation unit which > includes the header. Presumably the compiler is smart enough not to > do that, but it's not good practice. Thanks for the explanation. Makes sense to me. Just wanted to check before sending V2, Is it OK if I add this to kernel/fork.c? or do you have something else in mind? Regards, Sai