From patchwork Wed Dec 20 07:47:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3Vhbi1ZaW5nIExlZSAo5p2O5Yag56mOKQ==?= X-Patchwork-Id: 13499627 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 EB4DEC3DA6E for ; Wed, 20 Dec 2023 07:48:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52ED38D0003; Wed, 20 Dec 2023 02:48:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B7698D0001; Wed, 20 Dec 2023 02:48:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 358D28D0003; Wed, 20 Dec 2023 02:48:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 22F578D0001 for ; Wed, 20 Dec 2023 02:48:52 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D9BB714099D for ; Wed, 20 Dec 2023 07:48:51 +0000 (UTC) X-FDA: 81586420062.02.370B906 Received: from mailgw02.mediatek.com (mailgw02.mediatek.com [216.200.240.185]) by imf23.hostedemail.com (Postfix) with ESMTP id 17B6C14000B for ; Wed, 20 Dec 2023 07:48:48 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=eTgT4jLA; spf=pass (imf23.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703058529; 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=zWnIxvvt9i9Arc7rR/Bktc59NaeLptNqSNuvQsls8/s=; b=KbD5tgYiYKdpF+6waQcHMLz3YRbbIIW6+gsj1ClRTOsw1kNps1+EqSDkCN/j/OfEZZC9/h hiS9Q2aANyLcqeRP77iJUVURQEqZIMm2bEzh9n8hp4zssX8qorvxZqtvTqR6sMm4NrAEv/ 3bDwHA2D22rDYUVuixywY3J5Pisv9wI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=mediatek.com header.s=dk header.b=eTgT4jLA; spf=pass (imf23.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.185 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com; dmarc=pass (policy=quarantine) header.from=mediatek.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703058529; a=rsa-sha256; cv=none; b=nsXUYD4gCoi3S9k3A1P+CxhECUJvB+RbfL4YxGDI3psJdjvnn5iwLbybLgM/LBkdm0DDhu WsBZfKD2SRH+A9Stir787VH54skb6TXn84Ga8jyxxz6KPgxEOokLzmWi8/qytpZpAO4vOG EPBXIGO5yhVWbF3d9UjAFqnYAR+U/70= X-UUID: 330371a89f0c11ee958cff29c719f35b-20231220 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=zWnIxvvt9i9Arc7rR/Bktc59NaeLptNqSNuvQsls8/s=; b=eTgT4jLA87EuL8ZD2Xc5k1/KIXqXnUPNmvI5RRYrSTyHXXl7Nf+3mbe6IQeeutC31Hz4+rfhf0VDl7jz0xxIEam6In3creyP8txNSXs/h2IgStMj0MrH59OhVy5RVrhmB0acvPMr0iNaKUHHGsmMrOjE1ZnD6gJ427S4qiUnHtE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:48860895-8f61-4cf1-b620-d374c14dd116,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5d391d7,CLOUDID:97cf5f8d-e2c0-40b0-a8fe-7c7e47299109,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 330371a89f0c11ee958cff29c719f35b-20231220 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 944657187; Wed, 20 Dec 2023 00:48:43 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 20 Dec 2023 15:48:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 20 Dec 2023 15:48:09 +0800 From: Kuan-Ying Lee To: Andrew Morton , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , Kuan-Ying Lee , , , Subject: [PATCH] mm: page_alloc: remove duplication of free_one_page() Date: Wed, 20 Dec 2023 15:47:56 +0800 Message-ID: <20231220074757.3656-1-Kuan-Ying.Lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--1.042100-8.000000 X-TMASE-MatchedRID: JWnFpJnSkzs5HWa1kxc3Mc36paW7ZnFoBCxvLPUx407fUZT83lbkEK1r wNdVdYipgrCec5Bjx+qAMuqetGVetnyef22ep6XYro1URZJFbJvd1KJkmiEcSkExS0sIXgpfF27 mDyBvZ5CSjwm7NH6qsNECzCqMxVGBuUqn/hcBctSNWcj5w63xsn8wdqmWSBW9n1s5w+bk2xuOh+ wyNBrFXDJiNuKohDcKzKSG3JdyKAPqtV2AGMNPavWdclq8lU1q X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.042100-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: F5135FF66DB980116838C225763DDE80253B6A99B2BB8055C0B14DC95FFE14C42000:8 X-MTK: N X-Rspamd-Queue-Id: 17B6C14000B X-Rspam-User: X-Stat-Signature: hnm885t5rmks4y3rjzjrhrnsspi84ike X-Rspamd-Server: rspam01 X-HE-Tag: 1703058528-187370 X-HE-Meta: U2FsdGVkX1/mqt1ivwGnkoqRqSRh5r+kgWiMR3eqLoZMGxmH7rSElHfLryb2sEnCn0/5nzpzC6ewtIrOSxaeXwMW/q72rzrDGlImOYAzLjkeICoSTKIdN/6hsefvDJoUTypyxrM6H3MN5L1aohRbz74wxqXv7bR0znCu3EyQ0uajw3bVw0MolJjbECAH1FK4Cu7vGV9eChJCjCjzRPEuI+GJ8MhaLQu/hUtRpoywhQi8uyf5dIwgjJysn35bUxeCHvtBWfRcoN7U38tYEF0GCiL5qWWu14Rm25Bb6D7rPWOX6mkNRqKwJgoeYUvGfdTtVSKGhPckUuz1GF8hUr0kpyXHLlOmWGQlXfHU/1DvIfRD3PCztIBT/8KBM1TTqvyglo7u63qfJ3oG0MoSvIGncCfq0c66VuVHefSUAoWX7PKkwlzy7rkKgjNZ6KVq8bcozWEXwA93V2KE25K8PDQEKvxfzh+n8u/gUY47JuMczs5ekWuZ7MY0LI78E/vEYQbZGB5lBmKXZ0bpNSvqffukWsvKC938x61J7WDXctllrXmEPttQOlHk3Go4mSX3VVheQqoqPvpLd7Cw9NJXR4zgdQmsSdpmeiosKQodSUBOV1wzB8I+UAutX84v1eT3jzexKlo3Tit90DtV+s009cKIbkn5UQkCdWg8HLOSEd/uTwZfs2m4h8J/IfBGnFpT1rjzkcyQ9D61DXISDWpKmEnFYFQCdctPRfhzp10Tmo2Yl4fCePLNYAYzPCfUu2bqrBf6hh4OybMHYb1oUX3ZoafpGb4LnEiIx2WRXP3IJedCtyiDOIXOFToN0QO+RhAcp+T8GM23sURfxZirP5UPvs21FuJbNNrhtu5oLs5oVH5uZML6TblpZa0LWLSOWPUFE0uCOw/cYupXWeMXYD1PVIKk/Ubj/pR1QtmaR5uVpCANSiNbFPAROpFWQQ0QGIxVyYdfFlvSCXTMCY1qP685eWI Ch2H+KpF vAh/h 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: List-Subscribe: List-Unsubscribe: Remove duplication of free_one_page(). Cc: Casper Li Signed-off-by: Kuan-Ying Lee --- mm/page_alloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2f646773a934..f46af8616cac 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1262,7 +1262,6 @@ static void free_one_page(struct zone *zone, static void __free_pages_ok(struct page *page, unsigned int order, fpi_t fpi_flags) { - unsigned long flags; int migratetype; unsigned long pfn = page_to_pfn(page); struct zone *zone = page_zone(page); @@ -1277,13 +1276,7 @@ static void __free_pages_ok(struct page *page, unsigned int order, */ migratetype = get_pfnblock_migratetype(page, pfn); - spin_lock_irqsave(&zone->lock, flags); - if (unlikely(has_isolate_pageblock(zone) || - is_migrate_isolate(migratetype))) { - migratetype = get_pfnblock_migratetype(page, pfn); - } - __free_one_page(page, pfn, zone, order, migratetype, fpi_flags); - spin_unlock_irqrestore(&zone->lock, flags); + free_one_page(zone, page, pfn, order, migratetype, fpi_flags); __count_vm_events(PGFREE, 1 << order); }