Received: by 10.223.164.202 with SMTP id h10csp4001512wrb; Tue, 28 Nov 2017 22:27:41 -0800 (PST) X-Google-Smtp-Source: AGs4zMakWBnWjFlxZPk0ghM1YMoyAtfU3wCdsh+qYBPhAPDt0Y6AgDnKNg3qT78TBstS6FyTI6LF X-Received: by 10.101.96.1 with SMTP id m1mr1792091pgu.38.1511936861393; Tue, 28 Nov 2017 22:27:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511936861; cv=none; d=google.com; s=arc-20160816; b=rO5VpajOE22WLan8Q6gzyZo5VQgf1ZhkcJxUjHMJX4O6o+NN6jDSAjLT5mRnQ3RhBw SS/AZb6SS1B3azBg10R2+0aWOIcyD0dPRopvfIEem4hPwNDVO+HKNgRHgARliiFjmBVo 4yDlXVgNBobLiIoXxJNlkzbzL+V7Tz2dTlWQgM4UJEFe1QFlwb/0NKAxVD8WB8x8BCvs R5a8PDm+PibWNJ2wxTrmjHA7g1qhMiiMzrudhlyNB8263dhTjdnNbbCt/lJHQhkqf55d Pg8k1P+fYOj4lT5oM1oqLuSV9KdS6j8tG5rzDnxi3lKY11jiIAmwhh7QKTc0BGRHViCG +XWg== 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:arc-authentication-results; bh=krgBCWtPl8w/uFG5u3ZHSNjcJ1Kc8Q3oEbsP58xEeSc=; b=KINBQSaL+t0B4ELLu2cFkhEL5lzbHRe25URfOQzSB1E0dY+eWKTDl980xEWYkf0QWj X9HNeVaZCH+INp6SnvBj1gqhZ8RLTLbg6AneoVHNqb7zjI1kbeVH5eN/lcFNUI6vDc5P m4JFFC24vY2RUVDlJbIaCobltXOs9sjjiNrHj79PWnYrmJumbyeT0ETXwouTKX8l166L 9cTf1Kq0Yo3jNgtgB2jcahJQWv9NI5zEBLEKKnIwGneOLAjhNfaperJRZBLgg+yHG6BH gSbL19ROjFZ/fppR4vNwfcclgmw2g7bza3DIDBC9ELjLGUR4HwK/IhyLXnUR6TRlFnNR XOIw== 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 t10si753079plh.762.2017.11.28.22.27.30; Tue, 28 Nov 2017 22:27:41 -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 S1752039AbdK2G0L (ORCPT + 71 others); Wed, 29 Nov 2017 01:26:11 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:42123 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbdK2G0J (ORCPT ); Wed, 29 Nov 2017 01:26:09 -0500 Received: from unknown (HELO lgeamrelo04.lge.com) (156.147.1.127) by 156.147.23.53 with ESMTP; 29 Nov 2017 15:26:08 +0900 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.222.138) by 156.147.1.127 with ESMTP; 29 Nov 2017 15:26:07 +0900 X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Wed, 29 Nov 2017 15:32:08 +0900 From: Joonsoo Kim To: Mel Gorman Cc: Johannes Weiner , Vlastimil Babka , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] mm, compaction: direct freepage allocation for async direct compaction Message-ID: <20171129063208.GC8125@js1304-P5Q-DELUXE> References: <20171122143321.29501-1-hannes@cmpxchg.org> <20171123140843.is7cqatrdijkjqql@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171123140843.is7cqatrdijkjqql@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 23, 2017 at 02:08:43PM +0000, Mel Gorman wrote: > 3. Another reason a linear scanner was used was because we wanted to > clear entire pageblocks we were migrating from and pack the target > pageblocks as much as possible. This was to reduce the amount of > migration required overall even though the scanning hurts. This patch > takes MIGRATE_MOVABLE pages from anywhere that is "not this pageblock". > Those potentially have to be moved again and again trying to randomly > fill a MIGRATE_MOVABLE block. Have you considered using the freelists > as a hint? i.e. take a page from the freelist, then isolate all free > pages in the same pageblock as migration targets? That would preserve > the "packing property" of the linear scanner. > > This would increase the amount of scanning but that *might* be offset by > the number of migrations the workload does overall. Note that migrations > potentially are minor faults so if we do too many migrations, your > workload may suffer. > > 4. One problem the linear scanner avoids is that a migration target is > subsequently used as a migration source and leads to a ping-pong effect. > I don't know how bad this is in practice or even if it's a problem at > all but it was a concern at the time IIUC, this potential advantage for a linear scanner would not be the actual advantage in the *running* system. Consider about following worst case scenario for "direct freepage allocation" that "moved again" happens. __M1___F1_________________F2__F3___ M: migration source page (the number denotes the ID of the page) F: freepage (the number denotes the sequence in the freelist of the buddy) _: other pages migration scanner: move from left to right. If migration happens with "direct freepage allocation", memory state will be changed to: __F?___M1_________________F2__F3___ And then, please assume that there is an another movable allocation before another migration. It's reasonable assumption since there are really many movable allocations in the *running* system. __F?___M1_________________M2__F3___ If migration happens again, memory state will be: __F?___F?_________________M2__M1___ M1 is moved twice and overall number of migration is two. Now, think about a linear scanner. With the same scenario, memory state will be as following. __M1___F1_________________F2__F3___ __F?___F1_________________F2__M1___ __F?___M2_________________F2__M1___ __F?___F?_________________M2__M1___ Although "move again" doesn't happen in a linear scanner, final memory state is the same and the same number of migration happens. So, I think that "direct freepage allocation" doesn't suffer from such a ping-poing effect. Am I missing something? Thanks. From 1585354850762740474@xxx Tue Nov 28 23:36:43 +0000 2017 X-GM-THRID: 1584777147397009876 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread