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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 869FBECAAD3 for ; Fri, 9 Sep 2022 17:47:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EED4F6B0071; Fri, 9 Sep 2022 13:47:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9D2E6B0072; Fri, 9 Sep 2022 13:47:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D646A8D0001; Fri, 9 Sep 2022 13:47:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C35346B0071 for ; Fri, 9 Sep 2022 13:47:01 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 923F1A0A67 for ; Fri, 9 Sep 2022 17:47:01 +0000 (UTC) X-FDA: 79893277842.12.8283527 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id B26E9C009F for ; Fri, 9 Sep 2022 17:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+qfnke7dblFKnShWAE8ZArMDaS/a0/dP7yRank+zcTk=; b=USwc5j3XgrJaRE3PhufuvlzUPu q6I4EfGwx3VrN0XeWlw4EKJirsh0SkRyI8qdTBZXJ3jMk1uNgeNLkKnPH+5P6BPV/FtHwoC0t7OJE VnIpBHEBmnZjIKIsW45kqKDEav7vS7PHxRHLlxAjWeXIAxiquSLGZeb8gcy7hShUYxh6rvE9X8Iuv dyzfe/vFUrCio8plN4izduLpH0uFovOt81N/EAoOttYZvHCVmqeNM1CO47dqN/UxYWyzxA6mRmwsq DspeoROkoPNQOoQPz6O5C/YbcPPCAfTUEYbV91JxFaWfMZhuc0ms8ftgKOx7PueP7o85qXDhhGEdU CwIH4dOQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWi5X-00DRY8-5w; Fri, 09 Sep 2022 17:46:47 +0000 Date: Fri, 9 Sep 2022 18:46:47 +0100 From: Matthew Wilcox To: Cheng Li Cc: mike.kravetz@oracle.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm: use nth_page instead of mem_map_offset mem_map_next Message-ID: References: <1662708669-9395-1-git-send-email-lic121@chinatelecom.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1662708669-9395-1-git-send-email-lic121@chinatelecom.cn> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662745620; a=rsa-sha256; cv=none; b=DEOcXVisCJg8AYuy05uoxiwj11iEH38Edhcc1j/lA2hbVgSp7vZK05BUhNfCPN5+ZWUrS5 yzH5vKI4O8cBZEItL50XCppnVsmfiJpnrUSpu4ikKufgZDA0ppAzCHzHdryn8Wxb3ARpXf 9HZlJRPBYJbT2OD91WQUMt9i5XSmx88= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=USwc5j3X; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662745620; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+qfnke7dblFKnShWAE8ZArMDaS/a0/dP7yRank+zcTk=; b=JUVHGg5Y+OLoLRu3VMPBDHTYPNFha4H4jMEMX5JbCYh10vgcIcC4qRnTn3ZaFBu6mcR0DG TTiqbo4zDuMCnlN/fNWMeKMiWtqzcWnzhNn1/QcL7p5o0pQqnx2CwxxgYFze6q6iVq+CCA HOoEeKQ/Vh8BSB+us7zcnj5tg0QS5CI= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B26E9C009F Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=USwc5j3X; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: yij4r7swnf88oudoxrk19d4mxzae633u X-Rspam-User: X-HE-Tag: 1662745620-402500 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 Fri, Sep 09, 2022 at 07:31:09AM +0000, Cheng Li wrote: > To handle discontiguity case, mem_map_next() has a parameter named > `offset`. As a function caller, one would be confused why "get > next entry" needs a parameter named "offset". The other drawback of > mem_map_next() is that the callers must take care of the map between > parameter "iter" and "offset", otherwise we may get an hole or > duplication during iteration. So we use nth_page instead of > mem_map_next. > > And replace mem_map_offset with nth_page() per Matthew's comments. > > Signed-off-by: Cheng Li > Fixes: 69d177c2fc70 ("hugetlbfs: handle pages higher order than MAX_ORDER") Reviewed-by: Matthew Wilcox (Oracle)