Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3505151ybh; Mon, 5 Aug 2019 20:14:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqpexILzWSl6WCW+rHugABh/d2qN9B1gIcaIJMnYhNqWBb2hzZOA/N56BhDLjn/ESeOUs/ X-Received: by 2002:a17:902:7283:: with SMTP id d3mr893810pll.93.1565061244930; Mon, 05 Aug 2019 20:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565061244; cv=none; d=google.com; s=arc-20160816; b=ekIpTVMshaRS1o32W5PfkUywu5ksXJv+W26zqRisNSyxuEsHCjRqQHyqzOScga1u9V pOEePapIHRouS+19F6n8rSVh12E/wKFztXGq9VNutL3L60SEsMk+OyLClMPQF9W+UsLd Zos8euYqq2c7ldkuyQrESHoxLZy0QlMGM2NwcaQmkL/ru/Xu/bNe3r5RGrYtr+1nWFCX zSCSYsLOxO6nKnY5PpXsSRXa30NiKlt69lkQ7yIGlRjP/eQU3ulfEQJnwKrjNnKZT0fP Rzy1rAMR3Eu9aUzCDjSIpgtAqtiUC+18OC+sDi0OyriMiM4JNuPHnufrQkx9RgvxztgI K0SQ== 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=sHPq+pRx/+dTblW9pr6QipciNsC2rS/a9IQw+GuW4FY=; b=sOFrweO7Wp0VkN8N1auuFyJB0MH35hq84ufmlAqVXtweSnfvCK+t7iCLZMb5DJBLFk z46XN5nxogGd6GrR1mYGnuJU28njdiD5WZKo+VfFYic9Y+Xuumb8+cSkGoYxBVINJybQ XM+GJCIt62nhKRZ8im2WGbbGAvvBjw3TNuFtrC0UKjUinzc6/nklgtHmCqDW5D7sJEwV b9JwYd7sXHk/OPtYSd6qPZiDZ8QynX1HRMVIQ7oM9Frj/h6A/41oaJXoyvyauzwyHLB0 P9ttmSFPLQ0yeaF/I5NobFHXkaz96JiiRRuVR01a2Q/15yr+EV6UtRX8y9SkHZnv6fEM YHJw== 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 c11si14650627pjq.0.2019.08.05.20.13.48; Mon, 05 Aug 2019 20:14:04 -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 S1730578AbfHFDNK (ORCPT + 99 others); Mon, 5 Aug 2019 23:13:10 -0400 Received: from mga05.intel.com ([192.55.52.43]:62755 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbfHFDNJ (ORCPT ); Mon, 5 Aug 2019 23:13:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 20:13:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,352,1559545200"; d="scan'208";a="202666879" Received: from sai-dev-mach.sc.intel.com ([143.183.140.153]) by fmsmga002.fm.intel.com with ESMTP; 05 Aug 2019 20:13:09 -0700 Message-ID: <1c6a18dd63e6005045034ccc7b04390ab3c605e5.camel@intel.com> Subject: Re: [PATCH] fork: Improve error message for corrupted page tables From: Sai Praneeth Prakhya To: Vlastimil Babka , Andrew Morton Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Hansen, Dave" , Ingo Molnar , Peter Zijlstra Date: Mon, 05 Aug 2019 20:09:59 -0700 In-Reply-To: <4236c0c5-9671-b9fe-b5eb-7d1908767905@suse.cz> References: <20190730221820.7738-1-sai.praneeth.prakhya@intel.com> <20190731152753.b17d9c4418f4bf6815a27ad8@linux-foundation.org> <20190731212052.5c262ad084cbd6cf475df005@linux-foundation.org> <4236c0c5-9671-b9fe-b5eb-7d1908767905@suse.cz> 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 On Mon, 2019-08-05 at 15:28 +0200, Vlastimil Babka wrote: > On 8/2/19 8:46 AM, Prakhya, Sai Praneeth wrote: > > > > > > +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? > > > > > > I was thinking somewhere like mm/util.c so the array could be used by > > > other > > > code. But it seems there is no such code. Perhaps it's best to just > > > leave fork.c as > > > it is now. > > > > Ok, so does that mean have the struct in header file itself? > > If the struct definition (including the string values) was in mm/util.c, > there would have to be a declaration in a header. If it's in fork.c with > the only users, there doesn't need to be separate declaration in a header. Makes sense. > > > Sorry! for too many questions. I wanted to check with you before changing > > because it's *the* fork.c file (I presume random changes will not be > > encouraged here) > > > > I am not yet clear on what's the right thing to do here :( > > So, could you please help me in deciding. > > fork.c should be fine, IMHO I was leaning to add struct definition in fork.c as well but just wanted to check with Andrew before posting V2. Thanks for the reply though :) Regards, Sai