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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 4E7DCC433DB for ; Sat, 26 Dec 2020 17:58:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13A52217A0 for ; Sat, 26 Dec 2020 17:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726320AbgLZR6O (ORCPT ); Sat, 26 Dec 2020 12:58:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgLZR6N (ORCPT ); Sat, 26 Dec 2020 12:58:13 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C73CC061757 for ; Sat, 26 Dec 2020 09:57:33 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id s26so15308698lfc.8 for ; Sat, 26 Dec 2020 09:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=JiLZpPHDeFio2xKaqd4AF6b+AaACUv2JAlVW2TC/2qFFp6T2XByLfEVcoTR8ni+2ir VahaBF7tUkyt0AUQJGX/7pPCiMG9x70Kxcco01Hh4iOJRmaJRmVWUdq7UwxeDmLQofJc n0wyg+xmy7/jzNvOpKECnfI8lHqRJ9kujirOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=Ku0vXFHDAQwldzO+Tm9HvpgJG4mQr/y+Swx9wSNqwfK6QLVCXm7AZHHaQiN4jthGS0 jpfFEPNHSEIudy3c/lr+u+I/kDCszV52ues4kXRPYrcR++XlQWvP5mKcnrIohESno4RF 7vxK6BQELgdkG8FThzZSq/0TiHxclOC969BxLHgljj8MBQk2OPAodGZpJGAelyB7gMJd ao/2DM5K0o2LAGdYz6pHbEL4S4DUJFsZO3qA1bmfbPn7BTA9pBhdgUHgzo0I7XPCoSgP kWi1HpRj+EaRDywkDbkdaAYwg9ycX3Dr1cAXxdJn6I96Crf4nhS2QvGOFwDsa0GjTC3q zj6Q== X-Gm-Message-State: AOAM533KR002kG3cK7hfPS7oxMJaz532cncK5fLt3GXkgrY3fTST8R+N 9vBQfuNoSqHDDorhx42iAlBTNSTAqF0fZQ== X-Google-Smtp-Source: ABdhPJwULiMTVz5e4FYoxC5J31NH+aB6cmGjO5WFAIIt23cLAQ1IGUdenoxN9Z5LemlcGZIyJ/2bMw== X-Received: by 2002:a2e:98d1:: with SMTP id s17mr13850890ljj.308.1609005451392; Sat, 26 Dec 2020 09:57:31 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id v6sm4731316lfa.200.2020.12.26.09.57.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Dec 2020 09:57:29 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id x20so15265339lfe.12 for ; Sat, 26 Dec 2020 09:57:29 -0800 (PST) X-Received: by 2002:a05:6512:789:: with SMTP id x9mr15301778lfr.487.1609005449200; Sat, 26 Dec 2020 09:57:29 -0800 (PST) MIME-Version: 1.0 References: <20201216170703.o5lpsnjfmoj7f3ml@box> <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> <20201219124103.w6isern3ywc7xbur@box> <20201222100047.p5zdb4ghagncq2oe@box> <20201225113157.e7hmluffh56fszfc@box> In-Reply-To: <20201225113157.e7hmluffh56fszfc@box> From: Linus Torvalds Date: Sat, 26 Dec 2020 09:57:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" Cc: Hugh Dickins , Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 25, 2020 at 3:31 AM Kirill A. Shutemov wrote: > > The new helper next_page() returns a stablized page, so filemap_map_pmd() > can clearly decide if we should set up a page table or a huge page. I really like that next_page() abstraction, my only comment is that I think it should be renamed as "next_stable_page()" or something, and then this part: + if (!page) + page = xas_find(xas, end_pgoff); + else + page = xas_next_entry(xas, end_pgoff); should be in the caller. Then just have two helper functions like 'first_map_page()' and 'next_map_page()' which just do next_stable_page(xas_find(xas, end_pgoff)) and next_stable_page(xas_next_entry(xas, end_pgoff)) respectively. Because not only does that get rid of the "if (page)" test, I think it would make things a bit clearer. When I read the patch first, the initial "next_page()" call confused me. But maybe I'm just grasping at straws. Even in this format, I think it's a nice cleanup and makes for more understandable code. Linus 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 BDAA9C433E0 for ; Sat, 26 Dec 2020 17:57:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35673217A0 for ; Sat, 26 Dec 2020 17:57:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35673217A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4787E8D008F; Sat, 26 Dec 2020 12:57:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 427488D0080; Sat, 26 Dec 2020 12:57:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F0448D008F; Sat, 26 Dec 2020 12:57:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 1A0438D0080 for ; Sat, 26 Dec 2020 12:57:34 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CCE8B181AEF0B for ; Sat, 26 Dec 2020 17:57:33 +0000 (UTC) X-FDA: 77636190786.17.blade06_1208ecc27484 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id AEC10180D0180 for ; Sat, 26 Dec 2020 17:57:33 +0000 (UTC) X-HE-Tag: blade06_1208ecc27484 X-Filterd-Recvd-Size: 5244 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Dec 2020 17:57:33 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id m12so15327966lfo.7 for ; Sat, 26 Dec 2020 09:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=JiLZpPHDeFio2xKaqd4AF6b+AaACUv2JAlVW2TC/2qFFp6T2XByLfEVcoTR8ni+2ir VahaBF7tUkyt0AUQJGX/7pPCiMG9x70Kxcco01Hh4iOJRmaJRmVWUdq7UwxeDmLQofJc n0wyg+xmy7/jzNvOpKECnfI8lHqRJ9kujirOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=HJCqX1NoIaD1nm0AOfYcTExv6zEiuGOzckG9JQUPqPNJfC9BtRrn40DXuuX+7cNa/u /sBfflSVHAZB+oQwlD6whIi3TibOiLJ99Bwwbqwui6wPBMaJXRWgu7i/D6+0/SaWhQtn ghcGDcenqqCNju1KDsAG4LzTv/DrUTp7CYD4nPU2V+gFYsV4SfAkPyOm8CETlpul4men lWomguzNnwHVopuuMMxzaENfHO4nNoj/YCFkFUU7Xe/6NE7abD6gtK+QAy4SjRaMFoLu 6/meaNF6ky75PIZzYr3S+rzCdYjx5ku8XQRiNu/dDsV4x85LmwE3SOv2rlo6oaFopcns ua7A== X-Gm-Message-State: AOAM531yC0wWy/rqpE7C3w7wRoUTqAU3N0AbebupbK+PFcrSoThnoT4Z iWlGKOvG3j/Qf/6hnlH0Dzp7gz7Mv+LarQ== X-Google-Smtp-Source: ABdhPJyBxi+3mg8oTTgjl/P9FPK5GoTtwKmeVaZOBWKLREn5ejyLbWlpqh4pLLnBS0JBZHBfdpdffw== X-Received: by 2002:a2e:a584:: with SMTP id m4mr17629677ljp.247.1609005451242; Sat, 26 Dec 2020 09:57:31 -0800 (PST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id u8sm5509550ljj.1.2020.12.26.09.57.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Dec 2020 09:57:29 -0800 (PST) Received: by mail-lf1-f42.google.com with SMTP id y19so15215010lfa.13 for ; Sat, 26 Dec 2020 09:57:29 -0800 (PST) X-Received: by 2002:a05:6512:789:: with SMTP id x9mr15301778lfr.487.1609005449200; Sat, 26 Dec 2020 09:57:29 -0800 (PST) MIME-Version: 1.0 References: <20201216170703.o5lpsnjfmoj7f3ml@box> <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> <20201219124103.w6isern3ywc7xbur@box> <20201222100047.p5zdb4ghagncq2oe@box> <20201225113157.e7hmluffh56fszfc@box> In-Reply-To: <20201225113157.e7hmluffh56fszfc@box> From: Linus Torvalds Date: Sat, 26 Dec 2020 09:57:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" Cc: Hugh Dickins , Matthew Wilcox , "Kirill A. Shutemov" , Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , Vinayak Menon , Android Kernel Team Content-Type: text/plain; charset="UTF-8" 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, Dec 25, 2020 at 3:31 AM Kirill A. Shutemov wrote: > > The new helper next_page() returns a stablized page, so filemap_map_pmd() > can clearly decide if we should set up a page table or a huge page. I really like that next_page() abstraction, my only comment is that I think it should be renamed as "next_stable_page()" or something, and then this part: + if (!page) + page = xas_find(xas, end_pgoff); + else + page = xas_next_entry(xas, end_pgoff); should be in the caller. Then just have two helper functions like 'first_map_page()' and 'next_map_page()' which just do next_stable_page(xas_find(xas, end_pgoff)) and next_stable_page(xas_next_entry(xas, end_pgoff)) respectively. Because not only does that get rid of the "if (page)" test, I think it would make things a bit clearer. When I read the patch first, the initial "next_page()" call confused me. But maybe I'm just grasping at straws. Even in this format, I think it's a nice cleanup and makes for more understandable code. Linus 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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 2F431C433DB for ; Sat, 26 Dec 2020 18:00:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA1FE2082D for ; Sat, 26 Dec 2020 18:00:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA1FE2082D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=COx+yNIMO1Ii2RuNOsrNxW5d6HLmzfu9FuYWviafbZc=; b=aaXbLB8Eru5WFrm2xBQpWKFfA ukugG56sEJrJxwqDKUL/FJSAVp0QUp3cbtTPI6CcQ+RluSSQ4LVejih+0/X9rA1Jy4dsO9PGj+i6p XGFyvLHJ5Y2mX4GN/OhB9ffjK+Gp5gRsu893g0UfD6DFWALeSeWhh+AsuhZ4/bpOfnV/ydceYyThf ZkiBn1BBxjC+InPUgmBRVFDHnlvcthoMw4W0FBHrDwF2ioBNvNAvfO/3D/SHoeegAl/PK9QhTYilJ ws2L0nfvk/37DhckSx+z320NBZ7GZEWUUMbcuAylG+H1UYv0luyV0qNGYdiQ8Qhl0PaenwcpDhnXR ENxBgSwJA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktDp1-0007sU-HE; Sat, 26 Dec 2020 17:57:43 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktDot-0007rS-K8 for linux-arm-kernel@lists.infradead.org; Sat, 26 Dec 2020 17:57:36 +0000 Received: by mail-lf1-x132.google.com with SMTP id x20so15265511lfe.12 for ; Sat, 26 Dec 2020 09:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=JiLZpPHDeFio2xKaqd4AF6b+AaACUv2JAlVW2TC/2qFFp6T2XByLfEVcoTR8ni+2ir VahaBF7tUkyt0AUQJGX/7pPCiMG9x70Kxcco01Hh4iOJRmaJRmVWUdq7UwxeDmLQofJc n0wyg+xmy7/jzNvOpKECnfI8lHqRJ9kujirOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vB3TbcX+phhLHqNLVTnsPQIuYLV410SZ/S3x77H/Azk=; b=PKA70/Lx0KDYiSLvy8xJ+JespbvQllKenH7UYbAgAnGgjrjzRfnsBDDSMB+GL3tSDj KxEjtfIRPxFD7VIb1xtfN1KjEUib8Wrmxfoc5cWQoWJ3jSCjxuhbPuplzrKMLfqQznOx 22H+5F9G7Pi4sZGuSgaIGbCDdePogs/1Kwx3V/XIAXyF5GReCp63XUj7rDaClI2lSrIy y/WnE+/dHgfqCQKDNLcbdX9jV15mlDeXMTrE3dK3S+/CKMk1I35itMrZEuIodHLHRRAh zUq6gYTPAB6yWzwuxnAi45W3mkluoNZrvUf5dx8ujGfCqDWgR500bVU8frZ7fE8T+Sa7 qAMQ== X-Gm-Message-State: AOAM533AVSwIGHYSmqK2UWGr5YE8XizhfTTJWq+dSGitNHUZTTDfg50H 6hp4migNrYQO4L6umTSa80JGgFiduatx4Q== X-Google-Smtp-Source: ABdhPJxybtcByXALvkUsH72Ku6WtdxfYnxTALNIwL/FjCKqCc+6PV5/cg7HgM/0XJn/UlK2P6ijvEQ== X-Received: by 2002:ac2:47e7:: with SMTP id b7mr15365831lfp.117.1609005451354; Sat, 26 Dec 2020 09:57:31 -0800 (PST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id l8sm4674399lfd.276.2020.12.26.09.57.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Dec 2020 09:57:29 -0800 (PST) Received: by mail-lf1-f54.google.com with SMTP id o17so15353636lfg.4 for ; Sat, 26 Dec 2020 09:57:29 -0800 (PST) X-Received: by 2002:a05:6512:789:: with SMTP id x9mr15301778lfr.487.1609005449200; Sat, 26 Dec 2020 09:57:29 -0800 (PST) MIME-Version: 1.0 References: <20201216170703.o5lpsnjfmoj7f3ml@box> <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> <20201219124103.w6isern3ywc7xbur@box> <20201222100047.p5zdb4ghagncq2oe@box> <20201225113157.e7hmluffh56fszfc@box> In-Reply-To: <20201225113157.e7hmluffh56fszfc@box> From: Linus Torvalds Date: Sat, 26 Dec 2020 09:57:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting To: "Kirill A. Shutemov" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_125735_788140_1226A685 X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Android Kernel Team , Jan Kara , Minchan Kim , Catalin Marinas , Hugh Dickins , Linux Kernel Mailing List , Matthew Wilcox , Linux-MM , Vinayak Menon , Linux ARM , Andrew Morton , Will Deacon , "Kirill A. Shutemov" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 25, 2020 at 3:31 AM Kirill A. Shutemov wrote: > > The new helper next_page() returns a stablized page, so filemap_map_pmd() > can clearly decide if we should set up a page table or a huge page. I really like that next_page() abstraction, my only comment is that I think it should be renamed as "next_stable_page()" or something, and then this part: + if (!page) + page = xas_find(xas, end_pgoff); + else + page = xas_next_entry(xas, end_pgoff); should be in the caller. Then just have two helper functions like 'first_map_page()' and 'next_map_page()' which just do next_stable_page(xas_find(xas, end_pgoff)) and next_stable_page(xas_next_entry(xas, end_pgoff)) respectively. Because not only does that get rid of the "if (page)" test, I think it would make things a bit clearer. When I read the patch first, the initial "next_page()" call confused me. But maybe I'm just grasping at straws. Even in this format, I think it's a nice cleanup and makes for more understandable code. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel