Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3077452pxk; Sun, 4 Oct 2020 23:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWo4uwcCVIf1WWj6hBQ9/qHM/rQCM2H2C/kSEeH4aCxIiX/88x5EEPKl1Xa3KAL2ER/B2I X-Received: by 2002:a17:906:1152:: with SMTP id i18mr6187100eja.101.1601881174623; Sun, 04 Oct 2020 23:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601881174; cv=none; d=google.com; s=arc-20160816; b=XjdnRDK7olJuBDnx6mxIEbT6MfsLyDAAwWQCBPSNaM6My1Gs+szCOvI/PlHi7FX3RL 2HAaHaFiYNR0f6D7NGGTdkmhR+tFevNwkyJx90Gs+JRCDKnEMHffLKqd7JndtoulgudL hFuaufbDx7vkztnZ8kunMeolLu1v7OwKsQlgR4auThqpBWTiNLw0cp6HEQe+Pbu3EjA1 wIpb2oWrbMNKXt7gdMyEzMV+7sSP2sq8eFwsqeYxD11dx/U/PFXA7bi/d3Vo7mhlXVxU FRXOfBTnqnyz6HvH6dZ+aLM6Ynj8ZJacILaS89m1Cl6JwHOJnlnbJE3oxgfAm0cdIjRA LH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UNEm7Tn9UNlLqhlrULq94v99iXKf+1bbfGtGmTKX+7I=; b=1AaZeDLNGDbCjQAQB/hhAzAEBVSaZyF5dDJWFxrGkS3QrPoN9JMHfcMCnnsMdXS+L3 3QJz81ddQffz4B+IuZhBsXRWeZYuoFsPoh0dZP0oaowu3NOlSuiYC9pcIwEl8LIN2iEw 4VyTVg9cl5h6CXPrRn8kog45MTMtFs0qjh/C98rBxKGWwTtmCZwY7zGN+S9FIeAZ3F7o iH9wjHdg/rTS49r2PLl0zU0hRb035iRJ8e/d+MDsQXKm6WtkYKj7tSNv8rqoJ++P3yIv upM1CSiQhZnNEXSQHuiP2yWZRrF+J9b2L55ftVqDbl0ErhGzOyNJxVtXIVt83bXA+y8y XOaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=S66gtJ8a; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si1416319ejv.394.2020.10.04.23.59.11; Sun, 04 Oct 2020 23:59:34 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=S66gtJ8a; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725904AbgJEG4y (ORCPT + 99 others); Mon, 5 Oct 2020 02:56:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:36870 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbgJEG4w (ORCPT ); Mon, 5 Oct 2020 02:56:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1601881010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UNEm7Tn9UNlLqhlrULq94v99iXKf+1bbfGtGmTKX+7I=; b=S66gtJ8axc/8vLsDG0Y3zJ3DfLtemEkgIHkSLUIWIDdOmJTl5ozJHZlvC9eijR1y/3zccB UdINSjYVIGbyFe6FVLK6h+OkKKunrDQK6t3reRK6hhZJGiR0LMbXvjHxmXk9olvfWeq9+p FIB95YWX0cll+IESTIBsni+toXRKRnQ= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 93222B224; Mon, 5 Oct 2020 06:56:50 +0000 (UTC) Date: Mon, 5 Oct 2020 08:56:48 +0200 From: Michal Hocko To: David Hildenbrand , Mel Gorman , Vlastimil Babka Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, Andrew Morton , Oscar Salvador , Alexander Duyck , Dave Hansen , Wei Yang , Mike Rapoport , Scott Cheloha , Michael Ellerman Subject: Re: [PATCH v1 3/5] mm/page_alloc: always move pages to the tail of the freelist in unset_migratetype_isolate() Message-ID: <20201005065648.GO4555@dhcp22.suse.cz> References: <20200928182110.7050-1-david@redhat.com> <20200928182110.7050-4-david@redhat.com> <20201002132404.GI4555@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 02-10-20 17:20:09, David Hildenbrand wrote: > On 02.10.20 15:24, Michal Hocko wrote: > > On Mon 28-09-20 20:21:08, David Hildenbrand wrote: > >> Page isolation doesn't actually touch the pages, it simply isolates > >> pageblocks and moves all free pages to the MIGRATE_ISOLATE freelist. > >> > >> 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. > >> > >> Add a "to_tail" parameter to move_freepages_block() but introduce a > >> a new move_to_free_list_tail() - similar to add_to_free_list_tail(). > >> > >> This change results in all pages getting onlined via online_pages() to > >> be placed to the tail of the freelist. > > > > Is there anything preventing to do this unconditionally? Or in other > > words is any of the existing callers of move_freepages_block benefiting > > from adding to the head? > > 1. mm/page_isolation.c:set_migratetype_isolate() > > We move stuff to the MIGRATE_ISOLATE list, we don't care about the order > there. > > 2. steal_suitable_fallback(): > > I don't think we care too much about the order when already stealing > pageblocks ... and the freelist is empty I guess? > > 3. reserve_highatomic_pageblock()/unreserve_highatomic_pageblock() > > Not sure if we really care. Honestly, I have no idea. I can imagine that some atomic high order workloads (e.g. in net) might benefit from cache line hot pages but I am not sure this is really observable. If yes it would likely be better to have this documented than relying on wild guess. If we do not have any evidence then I would vote for simplicity first and go with unconditional add_to_tail which would simply your patch a bit. Maybe Vlastimil or Mel would have a better picture. -- Michal Hocko SUSE Labs