From patchwork Wed Sep 7 08:01:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenhua Huang X-Patchwork-Id: 12968581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4CDECAAD3 for ; Wed, 7 Sep 2022 08:01:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5BF086B0072; Wed, 7 Sep 2022 04:01:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 548938D0002; Wed, 7 Sep 2022 04:01:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E8278D0001; Wed, 7 Sep 2022 04:01:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2A1BA6B0072 for ; Wed, 7 Sep 2022 04:01:31 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id EEF68160FA4 for ; Wed, 7 Sep 2022 08:01:30 +0000 (UTC) X-FDA: 79884544740.31.9D699F8 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf07.hostedemail.com (Postfix) with ESMTP id 66B324005C for ; Wed, 7 Sep 2022 08:01:30 +0000 (UTC) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2877icrp014506; Wed, 7 Sep 2022 08:01:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=kVGBhnmmVLaHsutvMDyoZ6zUGI/cfItdEBWL5jrgzrs=; b=NXJOwgjwrnnfvpccDtjCSByUVZtHx318iPVit2cn155g4PrFJS5BVvmchTZo0l/eWDdb qlwET6ewxg7dpu4FGk+ZOyJQnbI+L+gJMBXI5+cplbMFaOaKg/YOhstTBCGfdfZajFfI W6RbaqOfRQ0Z6BrVmhpA0JXWbbc/byn1DRlTW2iJXBmgUUnu0koZdsr+7lx2CSicgbxd 4kXTL8hRBhGE6YOaRldsE/cBnP/MJTHqZ7kroMQnYtZEM+ww1bRVIGQFGX5Pz1mIwyyX uOtps3otqvZ1PeH+O2NJ/tfH5MefLM044TeHc8YTHJA4rbkV6IMLTdx74o+g41Iycr4H LQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3je25nukps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 08:01:29 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 28781SMD031449 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Sep 2022 08:01:28 GMT Received: from zhenhuah-gv.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 7 Sep 2022 01:01:26 -0700 From: Zhenhua Huang To: CC: Zhenhua Huang , , Subject: [PATCH] mm/page_owner.c: remove redudant drain_all_pages Date: Wed, 7 Sep 2022 16:01:13 +0800 Message-ID: <1662537673-9392-1-git-send-email-quic_zhenhuah@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: xnoyN8B2iXRIzLILMg82jI9AAG_v1Rxu X-Proofpoint-GUID: xnoyN8B2iXRIzLILMg82jI9AAG_v1Rxu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-07_04,2022-09-06_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1011 mlxscore=0 mlxlogscore=887 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209070034 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662537690; a=rsa-sha256; cv=none; b=c0MllduMHAFREIFiV2Z4LO+nP2mbU7R6xgdag/ondXlHXVgAZ38fNdgJ8/OmJ+ueOlZQb6 OMU73Q9bGPC/LHBZQkQr5sgZK4kKIf3ZgDOlglFZwW7kZ4VzFLqS2rDfTGUPDYlk/N9jcG ym90r9Tx5Xs93+Q4pmmh0nSAPuSt0+U= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=NXJOwgjw; spf=pass (imf07.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662537690; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=kVGBhnmmVLaHsutvMDyoZ6zUGI/cfItdEBWL5jrgzrs=; b=JtQQhdffQozssz14NEwswAgYksRWBDn9RHJCsMhYrdfNqpvJgCvTaAQk91LtFwE8/ceHKn mUyu6f/sdey3Z/btG1NiT+NXNPZs9k9TD628wSYaPA6AdfDnJgQTYiKH2X+OjBnS6l9+BW 8IO00ZkcT5AS8AMqpYSDvGu8JSJk1bQ= X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=NXJOwgjw; spf=pass (imf07.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-Rspamd-Server: rspam04 X-Stat-Signature: kgr9mwng6y3k5au3hbmtsdtbw11w5pc3 X-Rspamd-Queue-Id: 66B324005C X-HE-Tag: 1662537690-298049 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Page owner info of pages in pcp list have already been reset: free_unref_page -> free_unref_page_prepare -> free_pcp_prepare -> free_pages_prepare which do page owner reset -> free_unref_page_commit which add pages into pcp list It can also be confirmed from dump that page owner info of pcp pages are correct. Hence there is no more need to drain when reading. Signed-off-by: Zhenhua Huang --- mm/page_owner.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_owner.c b/mm/page_owner.c index 90023f9..54f3e03 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -524,8 +524,6 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) while (!pfn_valid(pfn) && (pfn & (MAX_ORDER_NR_PAGES - 1)) != 0) pfn++; - drain_all_pages(NULL); - /* Find an allocated page */ for (; pfn < max_pfn; pfn++) { /*