From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9A50C43460 for ; Thu, 15 Apr 2021 09:33:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 29BA161249 for ; Thu, 15 Apr 2021 09:33:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29BA161249 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A8D4F6B0036; Thu, 15 Apr 2021 05:33:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A3C2C6B006C; Thu, 15 Apr 2021 05:33:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DE196B0070; Thu, 15 Apr 2021 05:33:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 6E57B6B0036 for ; Thu, 15 Apr 2021 05:33:41 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1DF2C1802228F for ; Thu, 15 Apr 2021 09:33:41 +0000 (UTC) X-FDA: 78034089042.29.37443A2 Received: from outbound-smtp37.blacknight.com (outbound-smtp37.blacknight.com [46.22.139.220]) by imf14.hostedemail.com (Postfix) with ESMTP id 0F3B5C0007CE for ; Thu, 15 Apr 2021 09:33:31 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id E57481954 for ; Thu, 15 Apr 2021 10:33:38 +0100 (IST) Received: (qmail 7775 invoked from network); 15 Apr 2021 09:33:38 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 15 Apr 2021 09:33:38 -0000 Date: Thu, 15 Apr 2021 10:33:37 +0100 From: Mel Gorman To: Vlastimil Babka Cc: Linux-MM , Linux-RT-Users , LKML , Chuck Lever , Jesper Dangaard Brouer , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Michal Hocko Subject: Re: [PATCH 07/11] mm/page_alloc: Remove duplicate checks if migratetype should be isolated Message-ID: <20210415093337.GH3697@techsingularity.net> References: <20210414133931.4555-1-mgorman@techsingularity.net> <20210414133931.4555-8-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0F3B5C0007CE X-Stat-Signature: to358di3pig4uo6ig391h7kpqgmnkcn4 Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=outbound-smtp37.blacknight.com; client-ip=46.22.139.220 X-HE-DKIM-Result: none/none X-HE-Tag: 1618479211-923066 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: On Wed, Apr 14, 2021 at 07:21:42PM +0200, Vlastimil Babka wrote: > On 4/14/21 3:39 PM, Mel Gorman wrote: > > Both free_pcppages_bulk() and free_one_page() have very similar > > checks about whether a page's migratetype has changed under the > > zone lock. Use a common helper. > > > > Signed-off-by: Mel Gorman > > Seems like for free_pcppages_bulk() this patch makes it check for each page on > the pcplist > - zone->nr_isolate_pageblock != 0 instead of local bool (the performance might > be the same I guess on modern cpu though) > - is_migrate_isolate(migratetype) for a migratetype obtained by > get_pcppage_migratetype() which cannot be migrate_isolate so the check is useless. > > As such it doesn't seem a worthwhile cleanup to me considering all the other > microoptimisations? > The patch was a preparation patch for the rest of the series to avoid code duplication and to consolidate checks together in one place to determine if they are even correct. Until zone_pcp_disable() came along, it was possible to have isolated PCP pages in the lists even though zone->nr_isolate_pageblock could be 0 during memory hot-remove so the split in free_pcppages_bulk was not necessarily correct at all times. The remaining problem is alloc_contig_pages, it does not disable PCPs so both checks are necessary. If that also disabled PCPs then check_migratetype_isolated could be deleted but the cost to alloc_contig_pages might be too high. I'll delete this patch for now because it's relatively minor and there should be other ways of keeping the code duplication down. -- Mel Gorman SUSE Labs