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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 566D6ECAAD5 for ; Sun, 4 Sep 2022 21:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232094AbiIDVPj (ORCPT ); Sun, 4 Sep 2022 17:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbiIDVPh (ORCPT ); Sun, 4 Sep 2022 17:15:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31AFE1F63E for ; Sun, 4 Sep 2022 14:15:36 -0700 (PDT) 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=XsVMlt5hm6DrJhRld1OYvrTBNBmsOauY0XUQEvP4qQk=; b=U00f1HZ1fphnydaMdTK3Bvd2P+ y4veYWAISIY8EZF9zrLMhxxsm7mAe1XToDWjJW6R9TKnK+wbESAQvVYDkMjohZBrlYXP+MUe3aLfS VWWuNqtB+s+CZVKwBCkeqY6bwfxA4HF6CCBnuv6L/yFJK3H8V2j2rGEH3JxN05q+aWz+/lDcrh4gZ 6IOLVSmgNPT6rnZrnSKH4nxcr1nydiQL19uuE6vscIOj6TjV13Hy7aT9JVjfGNmLRv3EhTaBgiBPv 0OAPbpY2K377e//uCadaS4vFraHJyouODSRmnSKLl1XaAgsruX0OSclx5AnzVe29PsUpkL7u9AEtY rgHo763g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUwxa-008we9-Ri; Sun, 04 Sep 2022 21:15:18 +0000 Date: Sun, 4 Sep 2022 22:15:18 +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] mm: use mem_map_offset instead of mem_map_next Message-ID: References: <1662300161-22049-1-git-send-email-lic121@chinatelecom.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1662300161-22049-1-git-send-email-lic121@chinatelecom.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 04, 2022 at 02:02:41PM +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 mem_map_offset instead of > mem_map_next. I think we should go further and get rid of mem_map_offset(). nth_page() is now more efficient than mem_map_offset().