Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2522920ybl; Mon, 20 Jan 2020 04:37:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxUNUNF7oOYsicioEuYBtFXTTNvTwc0G8xesoKEsBeMrhzsBSgVThQQelj69Z6rnYYGBYEi X-Received: by 2002:a9d:73d9:: with SMTP id m25mr16184797otk.350.1579523846356; Mon, 20 Jan 2020 04:37:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579523846; cv=none; d=google.com; s=arc-20160816; b=FNbp5dG0ucn1+mcWktRoLtjnwd5SxRdfpFCiphFjz7jt3w7Al6Uxm35jp606hFlNCE PcR7SDHnIAsjiOQyX1Bw3oxIhcFzjqKt6ajFVcWrR0oAyR8wOoRT8h70PuvdkhUP6e/r Ys15rBlHgSLsf9B45KkYiENfe3Y20Km+5mA1uG2b+kCNIdXCMI7qkzujzOQ3Ij7Y3bsZ ANuuTnzImaC/LqDBIpRmwrQiI7WjD4WW+D5EzcljUBUugYqxJLI6q3Mf8VZHq0x8zL7u 3apQBAfhiC1FeIMKrulBDnALUUAaZSTLQLWxmdr566CMyTeDBr+Pi2qfipgMbXF6vBZG v4Ag== 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:reply-to:message-id :subject:cc:to:from:date; bh=rbuNXgJauW39vuZyleaZlKh+Q/sOZEoDfgN8znB+jf0=; b=wgLMTaL+6NWzdvoutLUaKDZSqs5zJiLHNpK5Wi2Y0Vbn5fwUB3zxx3rxX3uCBAYvDl FbAsh3HUeL4+fbUKs32NykyYbkpl6VSg0niJTEBaq5GBn4OaipjK8hQbI7y85uoSgPvL iUvA1wrs65M1Ht6nIVV8s+/eouhJ/MTu0et7HiHcBDozzY6ofpK7P4MULpej+ohs8CEQ M8geHrkduTrdlGmjr8jp2PAULEn3qtCpVVcXlFpLQW4PdLm/E8209W4svgaVixvd8lmh 0G1EGBrFmeNgCBaLb8VfPmZ8CqB7PLeIN95Cr6H7kuZkID2HntCxC5h8niC1e3xfDmRF YL5Q== 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 a9si18089434oib.59.2020.01.20.04.37.14; Mon, 20 Jan 2020 04:37:26 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbgATMgX (ORCPT + 99 others); Mon, 20 Jan 2020 07:36:23 -0500 Received: from mga05.intel.com ([192.55.52.43]:63518 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgATMgW (ORCPT ); Mon, 20 Jan 2020 07:36:22 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 04:36:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,342,1574150400"; d="scan'208";a="228378979" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 20 Jan 2020 04:36:10 -0800 Date: Mon, 20 Jan 2020 20:36:21 +0800 From: Wei Yang To: Anshuman Khandual Cc: Wei Yang , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com Subject: Re: [Patch v2 4/4] mm/page_alloc.c: extract commom part to check page Message-ID: <20200120123621.GE18028@richard> Reply-To: Wei Yang References: <20200120030415.15925-1-richardw.yang@linux.intel.com> <20200120030415.15925-5-richardw.yang@linux.intel.com> <3987ae0f-cbfc-1066-c78f-c5c6efc570ed@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3987ae0f-cbfc-1066-c78f-c5c6efc570ed@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 12:13:38PM +0530, Anshuman Khandual wrote: > > >On 01/20/2020 08:34 AM, Wei Yang wrote: >> During free and new page, we did some check on the status of page >> struct. There is some common part, just extract them. > >Makes sense. > >> >> Besides this, this patch also rename two functions to keep the name >> convention, since free_pages_check_bad/free_pages_check are counterparts >> of check_new_page_bad/check_new_page. > >This probably should be in a different patch. > In v1, they are in two separate patches. While David Suggest to merge it. I am not sure whether my understanding is correct. >> >> Signed-off-by: Wei Yang >> --- >> mm/page_alloc.c | 49 ++++++++++++++++++++++++------------------------- >> 1 file changed, 24 insertions(+), 25 deletions(-) >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index a7b793c739fc..7f23cc836f90 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -1025,36 +1025,44 @@ static inline bool page_expected_state(struct page *page, >> return true; >> } >> >> -static void free_pages_check_bad(struct page *page) >> +static inline int __check_page(struct page *page, int nr, >> + const char **bad_reason) > >free and new page checks are in and out of the buddy allocator, hence >this common factored function should have a more relevant name. Hmm... naming is really difficult. Do you have any suggestion? -- Wei Yang Help you, Help me