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,URIBL_BLOCKED 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 4E9B9C2BBD5 for ; Fri, 18 Dec 2020 18:58:41 +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 E3F3523B83 for ; Fri, 18 Dec 2020 18:58:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3F3523B83 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=CyqSnT4d81vQiywu7/yVdb+8xNrX0XvQKd/x32q9bPc=; b=BWitASQ/jOepTrPopi8VGlo7X K9iIdEC03bv4fghRu9XdaC7In3tJlhrSAbnmRl8ugkDDK+cE9nBCE1RvmlmRK4oLxB0j4OGydYaFZ 6FlfpEQY+xKV3rycRds4tr2wYePcP/WGWdfCuK0RcArMZkSVE1YY+LAHS29oiNujRdFdY4GGmhV4K g7k1h+OfL3VsiPRMkyyjmhWIgjrKG3GMIwiVq0ehyL7shvrfrgLJe6OktEQ9sw6SaHIE0zsJJ40kJ yvCu6BzYC4HJVG0sp2/6qhucTwpyaysx9FJsFISICn5ii9f1qFUW5XKvo/n9V5B9y0z+9Km5CPlnj PhWbpnEuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqKwM-0001O1-9k; Fri, 18 Dec 2020 18:57:22 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqKwG-0001NC-LU for linux-arm-kernel@lists.infradead.org; Fri, 18 Dec 2020 18:57:20 +0000 Received: by mail-lf1-x131.google.com with SMTP id a12so8004791lfl.6 for ; Fri, 18 Dec 2020 10:57:16 -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=uTkIwRPG9MysKSy4nLERH4DSVmgkNBJHlqN1//PDmMg=; b=dsF5q71ELOhRK7vGOEP6lscSDyihytaDJgLbWaXR+ZI6DYKPA+mGbTu53U5ZoRC/DL 1+pKhVd1B9xa8VF/IukiJOfVgOnuGio7+tX2NCp8romWhqh1y5rH2y2WQZkVKJAPYmgl Lvat0PcrqQdD0PeMMR7ynUxZiG5BSUcGfefI0= 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=uTkIwRPG9MysKSy4nLERH4DSVmgkNBJHlqN1//PDmMg=; b=PpovuPTszNVIaJ/YbKDQwEy6/C0sLtinCM5JLdZvSzWh266iC1X3q/+ttFeOQfsRYJ TPz6Qs2MRT+hmSlFczgjAftlKyDQlsJfbyqcGRNofCWxV7gjx39GyLs8G8sf4TzU3VmB sSft62eKClQ0H34ZdbmgCJcMvimRshrdcX2k2vMdRLsUX/r6eaLL+B30p7isaBzXw8gr U8uXgCg9/5LjWvfVZQyFc3Ho1jBvbR7R3nuE8u75IMqCHEca5wKEDmOXwCfdHhZJk60r ev1LgUZQaLuOH5B+aVH3kajUNYM2HewUPeeI3qRxJcqwxDm06WmbN2jky4KwnOULbB5l o6GA== X-Gm-Message-State: AOAM532qsVmGghqF+d4VGYAz7SZedCTitlq1MNEXhDbNOu4QzqFnvUUK LIxLkz2qRPrJ2563RIu9b+EHoqvigiG1dw== X-Google-Smtp-Source: ABdhPJyTuCfPVIuwlh+LAfCnH4CLf3s+rRF+sJIY3G0igXQkGfc9/+aljizelz3U4EZdQ3NC8AE6FA== X-Received: by 2002:ac2:4642:: with SMTP id s2mr2010207lfo.616.1608317834572; Fri, 18 Dec 2020 10:57:14 -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 e27sm1134284ljb.6.2020.12.18.10.57.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Dec 2020 10:57:12 -0800 (PST) Received: by mail-lf1-f54.google.com with SMTP id y19so7902220lfa.13 for ; Fri, 18 Dec 2020 10:57:11 -0800 (PST) X-Received: by 2002:a2e:9b13:: with SMTP id u19mr2332467lji.48.1608317831659; Fri, 18 Dec 2020 10:57:11 -0800 (PST) MIME-Version: 1.0 References: <20201209184049.GA8778@willie-the-truck> <20201210150828.4b7pg5lx666r7l2u@black.fi.intel.com> <20201214160724.ewhjqoi32chheone@box> <20201216170703.o5lpsnjfmoj7f3ml@box> <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> In-Reply-To: <20201218110400.yve45r3zsv7qgfa3@box> From: Linus Torvalds Date: Fri, 18 Dec 2020 10:56:55 -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-20201218_135716_720924_0A023EBD X-CRM114-Status: GOOD ( 12.41 ) 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 , Linux Kernel Mailing List , Matthew Wilcox , Linux-MM , Vinayak Menon , "Kirill A. Shutemov" , Andrew Morton , Will Deacon , Linux ARM 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 18, 2020 at 3:04 AM Kirill A. Shutemov wrote: > > This should do. See below. Looks fine. > > Then that second loop very naturally becomes a "do { } while ()" one. > > I don't see it. I haven't found a reasonable way to rework it do-while. Now that you return early for the "HEAD == NULL" case, this loop: for (; head; head = xas_next_entry(&xas, end_pgoff)) { [...] } very naturally becomes do { [...] } while ((head = xas_next_entry(&xas, end_pgoff)) != NULL); because the initial test for 'head' being NULL is no longer needed, and thus it's a lot more logical to just test it at the end of the loop when we update it. No? Maybe I'm missing something silly. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel