Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4944954pxu; Wed, 21 Oct 2020 09:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8g+fp3fo4JX+0uMBQCXj2auqNf1ltAWeffX2qBzC/kmnG3YWKm6lp3RgdrSvHaF+8wJAV X-Received: by 2002:a17:906:7254:: with SMTP id n20mr4052539ejk.382.1603296358041; Wed, 21 Oct 2020 09:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603296358; cv=none; d=google.com; s=arc-20160816; b=Ty8oUsPcszqqn9HFrgAzdC6mX5GYCDVJq5LyBDOi+kKitQ2o+NNgh/uLYUTOrOr5Ym MajSbd9l18VnWG3W/ctfN7c4haA8x/QCb8UDWpl/X1D+YBG74UpX4D/VPrr/IVFuUVvr 9o1DhhZzE6JFU4UQwd06yUAE3OpGcjLwbimhuO8q89CqamrO8HYJ5tktvDy2WUv/yHNb fLGcbkfab4L9oIMzpZQc4ZS0MZD00U9xP0lR5mrp+GhZTDQ4qBC0IJQ1zEiIWYBqujhW OwbDI7zHqszyQlgxlJl8EZ3xKUNGg9rKparuZUsitvFOub9HGgV5ITrc6LMX7bDsqwz5 9jIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=I+sVdp23joiUsonhwvSH/VXnjBMlQy24lEG7jSV5Xc0=; b=TX5kgN+QiHY/uXePE5AWwVKabKVqUf6niErRMH/sRCBjous5P/3A0ObGjJna++tCWW avGpA93kmGtJYFKnE5WnrzpNJQxQw86fYqOHUrmPmyUiDgKxVRtFwmXDrAOIB2Q4haf6 J05ox32bjDLp+rPIZahcgDtEsgZu9ymLLRF/Si9IGXFMq1xhwQOvNaIQiUB+V24S1yFe +ivInhaJtfwDwT9NjQVm7FyKFHlUDXmAu/zEPKt3tsE9iuyYvqwHy6EyuUd6kQUOZSOZ +ih85Fr+k+0S3HvQ8oCXEeDZMj6Tm4SDg7E26va/TKExsBKFVzKeMkDVEgvJIviR0+Ko DiTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si1711544edm.444.2020.10.21.09.05.35; Wed, 21 Oct 2020 09:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395298AbgJTRUZ (ORCPT + 99 others); Tue, 20 Oct 2020 13:20:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:53600 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730473AbgJTRUZ (ORCPT ); Tue, 20 Oct 2020 13:20:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EDB3BAC23; Tue, 20 Oct 2020 17:20:22 +0000 (UTC) Subject: Re: [PATCH v2 3/5] mm/page_alloc: move pages to tail in move_to_free_list() To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, Andrew Morton , Matthew Wilcox , Oscar Salvador , Pankaj Gupta , Wei Yang , Alexander Duyck , Mel Gorman , Michal Hocko , Dave Hansen , Mike Rapoport , Scott Cheloha , Michael Ellerman References: <20201005121534.15649-1-david@redhat.com> <20201005121534.15649-4-david@redhat.com> From: Vlastimil Babka Message-ID: <505935d6-90d2-3fce-57f0-5946968d6372@suse.cz> Date: Tue, 20 Oct 2020 19:20:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201005121534.15649-4-david@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/20 2:15 PM, David Hildenbrand wrote: > Whenever we move pages between freelists via move_to_free_list()/ > move_freepages_block(), we don't actually touch the pages: > 1. Page isolation doesn't actually touch the pages, it simply isolates > pageblocks and moves all free pages to the MIGRATE_ISOLATE freelist. > When undoing isolation, we move the pages back to the target list. > 2. Page stealing (steal_suitable_fallback()) moves free pages directly > between lists without touching them. > 3. reserve_highatomic_pageblock()/unreserve_highatomic_pageblock() moves > free pages directly between freelists without touching them. > > We already place pages to the tail of the freelists when undoing isolation > via __putback_isolated_page(), let's do it in any case (e.g., if order <= > pageblock_order) and document the behavior. To simplify, let's move the > pages to the tail for all move_to_free_list()/move_freepages_block() users. > > In 2., the target list is empty, so there should be no change. In 3., > we might observe a change, however, highatomic is more concerned about > allocations succeeding than cache hotness - if we ever realize this > change degrades a workload, we can special-case this instance and add a > proper comment. > > This change results in all pages getting onlined via online_pages() to > be placed to the tail of the freelist. > > Reviewed-by: Oscar Salvador > Acked-by: Pankaj Gupta > Reviewed-by: Wei Yang Reviewed-by: Vlastimil Babka