Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp519020ima; Fri, 1 Feb 2019 06:52:36 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibwe0PXpxM8dtAyz8OUydjF8DLuauU3ljkP8tNvpzKJ7s3sWqQLQRBP5059jQ10TwE+ZhIv X-Received: by 2002:a63:4745:: with SMTP id w5mr2626121pgk.377.1549032756089; Fri, 01 Feb 2019 06:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549032756; cv=none; d=google.com; s=arc-20160816; b=Iih00PqDFPOVt7TwW2UKDFHQ0PSq7/wqGg7B+/v3EU1uC6lj46aMPcpclqUA2w3exa 5y+I9BwLztpCBHGl0kU6pQOEf6eWNYtlDJeF+Y68M7Dc+DXz61X8l4Ds02xFcxMADyI9 6EMNDrTJjfnDGX2FO61x0BPrKfg0acYmxGb0gzDSxDC9/IFFzTz4Rc7Xlgqw1M9cOO6Q rNHhMk6s7/M9YBppUnHSL3g+6gSzAqjb/y8NYxqojCRfjaHZDyNJHrBKcBEfFVyzRvD2 XOrE6nut4JAV9fGGkhHG5xk7jQ60kqrpJbiGXM5bzIL41O2K+AfHV8wob7MUVDZ16psh RTcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cWWsySVqVJcS9DQ5I505uxTYUzB2XeZQfGnfzZLFOVM=; b=SW0vfsTgUXuAZas/tOr13oSVxlm4a9kGSc1tbRJSY1QQeZYDTdmwEa8NjmUzbex9Ln k7QFmRIwxlGoY3c5q3s3P/r9nxInUO/MdSJrtVat7JC4g6bkK8EmBqA6WvsOoQjwtDkm kFPeFIO7dABODGE3KpcJQDoEgq7i+buOmVgFM4fS/oucNOpsaGpR9wC5rRvejKb1sZ0y km9jAbuU4tujbjbf1Qf0GrsfVUEbKbc1fDT9IJPD79BB+MzElqVuvIJCVl2Fb5jUVEqj UhLjhg+HnPvouig73y3mydqmPJdkDOJq/WkFNjJldGPpgKKFFZqvlVVjs3ONzc6K8VmD 2tow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si424709plp.18.2019.02.01.06.52.20; Fri, 01 Feb 2019 06:52:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729747AbfBAOvm (ORCPT + 99 others); Fri, 1 Feb 2019 09:51:42 -0500 Received: from outbound-smtp11.blacknight.com ([46.22.139.106]:45310 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbfBAOvm (ORCPT ); Fri, 1 Feb 2019 09:51:42 -0500 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 9F9661C1CCF for ; Fri, 1 Feb 2019 14:51:40 +0000 (GMT) Received: (qmail 4119 invoked from network); 1 Feb 2019 14:51:40 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.225.79]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 1 Feb 2019 14:51:40 -0000 Date: Fri, 1 Feb 2019 14:51:39 +0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , David Rientjes , Andrea Arcangeli , Linux List Kernel Mailing , Linux-MM Subject: Re: [PATCH 11/22] mm, compaction: Use free lists to quickly locate a migration target Message-ID: <20190201145139.GI9565@techsingularity.net> References: <20190118175136.31341-1-mgorman@techsingularity.net> <20190118175136.31341-12-mgorman@techsingularity.net> <81e45dc0-c107-015b-e167-19d7ca4b6374@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <81e45dc0-c107-015b-e167-19d7ca4b6374@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 31, 2019 at 03:52:10PM +0100, Vlastimil Babka wrote: > > -/* Reorder the free list to reduce repeated future searches */ > > +/* > > + * Used when scanning for a suitable migration target which scans freelists > > + * in reverse. Reorders the list such as the unscanned pages are scanned > > + * first on the next iteration of the free scanner > > + */ > > +static void > > +move_freelist_head(struct list_head *freelist, struct page *freepage) > > +{ > > + LIST_HEAD(sublist); > > + > > + if (!list_is_last(freelist, &freepage->lru)) { > > Shouldn't there be list_is_first() for symmetry? > I don't think it would help. We're reverse traversing the list when this is called. If it's the last entry, it's moving just one page before breaking off the search and a shuffle has minimal impact. If it's the first page then list_cut_before moves the entire list to sublist before splicing it back so it's a pointless operation. -- Mel Gorman SUSE Labs