Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp402927rdb; Tue, 19 Dec 2023 23:48:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYBXyeqlXeOm1XYOOCPoWecF/kyDusO1cLwUp13+MjHhzmpfy/1amgi3acTn/UeUvtIiUC X-Received: by 2002:a17:907:968c:b0:a1b:70fe:e896 with SMTP id hd12-20020a170907968c00b00a1b70fee896mr11873368ejc.130.1703058507002; Tue, 19 Dec 2023 23:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703058506; cv=none; d=google.com; s=arc-20160816; b=LMlbW99yklLo5b8RftztPZswJl5tbQqFwEh5DgaQxAknFdBXW99O27RS14C7pWMnA3 GqAJjbviLohVCNF647SmXJZI0UhetLES2rgZs9Lx9K5dXQ0WcBwo5luFgTNzUv/907d4 xquGNDnERgxgNPvTUcWeH/6KAZmc9yJuyjx4lBTE6HsMML/SwMzMD/W/3FfLZGLCoIIY CpNmyyk1jZKY2NkEgt4vmjiMHjq1KrQstYAmAPw7TKVeNUpRELi4MA6EBsvAfAmy8BpU /REsLs7Rl2irg8GlRAhaDdnXzzDWFFsCqD2B8AcOm8l6hnCO67Etk+jNxEqaMokZ3fwl katg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=zWnIxvvt9i9Arc7rR/Bktc59NaeLptNqSNuvQsls8/s=; fh=47zquJnVDeGjz+9wzBJmyjvSz9DyGIZZ4J4BxTahVAg=; b=cddNfmE+ghihsQ8CtO+F4Z7ATo20d9I7Ow+KLMV2vjc4abFpppPZEkWqcZq1LAtYon JbaB+T+6MsCHgYgb40FzOsVcMW2E6nmcba+K8Nqb8v154a6t7i6n03aHhYdGSOJLKC6j 5Mq/E7//n8iL6Q2lDNqcg5rQJJPgUJh/JBok2iI0B3+Y95Xi7rhwyYyFHzOptIFiAe2/ rePSIIWUw9SgOyVZs3AceWpXmbqOoMf8FaIM1IaTNnHR96+cPRPqlhlSni6M60IjROt9 f4uiHfIPczzzwZwuNN/TuMjMl3vMJDMaWyUj6qpfz/Z12Ptl8e3Kualc49oJcYFIIhiP 2KRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=eTgT4jLA; spf=pass (google.com: domain of linux-kernel+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s24-20020a170906455800b00a23593b6e19si2328423ejq.892.2023.12.19.23.48.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 23:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=eTgT4jLA; spf=pass (google.com: domain of linux-kernel+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B9DAE1F26410 for ; Wed, 20 Dec 2023 07:48:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12748168C8; Wed, 20 Dec 2023 07:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="eTgT4jLA" X-Original-To: linux-kernel@vger.kernel.org Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C101E15AFF for ; Wed, 20 Dec 2023 07:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 1f5004a09f0c11eeba30773df0976c77-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:bdd8cb7b-dc44-4d0a-b6b9-8fd9036d6d26,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:f7edf881-8d4f-477b-89d2-1e3bdbef96d1,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: 1f5004a09f0c11eeba30773df0976c77-20231220 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 91579362; Wed, 20 Dec 2023 15:48:10 +0800 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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 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); } -- 2.18.0