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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 0B29DC433DB for ; Fri, 19 Mar 2021 09:57:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 898A264F53 for ; Fri, 19 Mar 2021 09:57:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 898A264F53 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 139B86B0075; Fri, 19 Mar 2021 05:57:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EA276B0078; Fri, 19 Mar 2021 05:57:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF3536B007D; Fri, 19 Mar 2021 05:57:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id D32EC6B0075 for ; Fri, 19 Mar 2021 05:57:51 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8D6308249980 for ; Fri, 19 Mar 2021 09:57:51 +0000 (UTC) X-FDA: 77936172342.33.C5EABAC Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf28.hostedemail.com (Postfix) with ESMTP id E44372000248 for ; Fri, 19 Mar 2021 09:57:50 +0000 (UTC) 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 ACF38AE05; Fri, 19 Mar 2021 09:57:49 +0000 (UTC) Date: Fri, 19 Mar 2021 10:57:47 +0100 From: Oscar Salvador To: Michal Hocko Cc: Vlastimil Babka , Andrew Morton , David Hildenbrand , Muchun Song , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/5] mm,compaction: Let isolate_migratepages_{range,block} return error codes Message-ID: <20210319095742.GA6409@linux> References: <20210317111251.17808-1-osalvador@suse.de> <20210317111251.17808-3-osalvador@suse.de> <20210317143827.GA20965@linux> <843f68e7-6fe6-54e7-976b-af8647482ac1@suse.cz> <5b294e86-e6a4-71ea-6a7e-1a611c6ccccf@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) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E44372000248 X-Stat-Signature: ns1f5t8uqm3n3wpbxbcozecqugkk3oh5 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1616147870-913663 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 Thu, Mar 18, 2021 at 12:36:52PM +0100, Michal Hocko wrote: > Yeah, makes sense. I am not a fan of the above form of documentation. > Btw. maybe renaming the field would be even better, both from the > intention and review all existing users. I would go with pfn_iter or > something that wouldn't make it sound like migration specific. Just to be sure we are on the same page, you meant something like the following (wrt. comments): /* * compact_control is used to track pages being migrated and the free pages * they are being migrated to during memory compaction. The free_pfn starts * at the end of a zone and migrate_pfn begins at the start. Movable pages * are moved to the end of a zone during a compaction run and the run * completes when free_pfn <= migrate_pfn * * freepages: List of free pages to migrate to * migratepages: List of pages that need to be migrated * nr_freepages: Number of isolated free pages ... */ struct compact_control { struct list_head freepages; ... With the preface that I am not really familiar with compaction code: About renaming the variable to something else, I wouldn't do it. I see migrate_pfn being used in contexts where migration gets mentioned, e.g: /* * Briefly search the free lists for a migration source that already has * some free pages to reduce the number of pages that need migration * before a pageblock is free. */ fast_find_migrateblock(struct compact_control *cc) { ... unsigned long pfn = cc->migrate_pfn; } isolate_migratepages() /* Record where migration scanner will be restarted. */ So, I would either stick with it, or add a new 'iter_pfn'/'next_pfn_scan' field if we feel the need to. -- Oscar Salvador SUSE L3