Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3104922pxu; Sat, 19 Dec 2020 12:11:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPH1gfQh9SfV3s69/LiaboFFtg7qZUV5esPWneb4UYbDG7Gsq7GlY/fgtR/NptBrYBWaUR X-Received: by 2002:a17:906:c45:: with SMTP id t5mr9602757ejf.370.1608408672178; Sat, 19 Dec 2020 12:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608408672; cv=none; d=google.com; s=arc-20160816; b=FdR6m6BeyP4DK/oekKGSg7f3WnCgDSWihi4dKd766YbGNMZj6RWSoq0PLHzIfRiZhM S8zxNGn6ORC7EwFytPDeIRgol1lLVGs95enC4xZUD0NMQ1xZOXQhbIyiKqh+RFskL4Wj N8XXA9GuIw8neC+K41lOTzkTU4qsvJh2rmzV1NmtyB3YND9iVX3CQLo25l1095sgOeI4 7PM7VrvD/mTJ4iswalNUEzCSQy4iErmHKBjHM4WPgtNbL0WBMElgP16uoJVgA9/3Sk4w bgnoR8Nvomea38s8OG0ltyH1oI2NavBCpSLinJGngDJYlSePY7unoyHtYeliipyNZ6dM T+nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SVODdPybrlcbXNP7lCnqd5UusuAf6ILXOIXCJqNGVzA=; b=mQ8fR+cfG5CjVEf9HPGLXC6xZ9g+P9Hz9hEIQl2jw4Rc5Y0UtvQ/hb7qx+NC5xkG4R +ARnRH9RTDRFkyC5Vn4/v526mISqy+9nyo6UCCAwAJpsNHol+nq7od8oEFaMewIxAD7E Jm3SMIXmbGs2qe5n5CFqbUnEwbfZUUsyW20w1hgvnBAdM4eDwCORq1lcxrPkn3wlU2Xt WcCwlXx22q9xUDv9b8ciVNA9eUetork/T1qlvTQVYTLmkoQzYkjYhHGJo0ERWNOZwuih ekv522WfopPImVQfC0ZtmnrlaqrT6tW1SxtV/yK+LBx9EmMTTKIW9AT4/LtNnR3Isi6Q XZ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Vi+1ed9O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh18si6801615ejb.624.2020.12.19.12.10.47; Sat, 19 Dec 2020 12:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Vi+1ed9O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbgLSUJW (ORCPT + 99 others); Sat, 19 Dec 2020 15:09:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbgLSUJW (ORCPT ); Sat, 19 Dec 2020 15:09:22 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84981C0613CF for ; Sat, 19 Dec 2020 12:08:41 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id s26so14244726lfc.8 for ; Sat, 19 Dec 2020 12:08:41 -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=SVODdPybrlcbXNP7lCnqd5UusuAf6ILXOIXCJqNGVzA=; b=Vi+1ed9OKjtopsq+1bVnAurIL+SBBBmWE1yCd+bEWojjNIE5+ScQRteZg58le8psS+ OGMgdv+vJwa8mhGIBiS2tBURhTt+WaaxRTNSsg8GVUONtSKPyRqWQUC9+pmlV1GECXio vXXjflwYbXnkzPzO43btJGKJJDEDqSKDZTI04= 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=SVODdPybrlcbXNP7lCnqd5UusuAf6ILXOIXCJqNGVzA=; b=MOy3yfO5f2Z8qR6o77k1HjSGgxgFW9fDhXH7z42QtRjb1RCQ2AtwAHB7ta0IZkAqmx TSbGOzWjcK/QW+YrsV3pCRLgz6DRz3vS3iYbA1hjwNxfp4jOSHWLCQKa7biOIOG+i44m dmqgP0huoKrpyLcpttOs6wrSiEj/W6osqo5+FX5HyWT0h2e8tm3L/3wTnbdirSB2eWEY YrQ6HRXxmzxxVlOWv480yPiE78wh06iFFNyP2+IEsSO2bMr+EkrEiu5IyxA2wa4oFrsH QqydHSOYuQ0/axE/rYZhauFlS2oteEmi/XSNGShd3Ia32leTlPRUj8riMnhhsZMnfi1P aJkg== X-Gm-Message-State: AOAM530c2J6bJmAgyq/ctDS4uxOTdpsTs6IQ1sRdKNmumc5cD5XdSTau 5C6U70KkjtjtYk9WkmdixFHcMY1mWYX/8A== X-Received: by 2002:a2e:390b:: with SMTP id g11mr4152225lja.239.1608408519680; Sat, 19 Dec 2020 12:08:39 -0800 (PST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id y23sm1528834ljc.119.2020.12.19.12.08.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Dec 2020 12:08:38 -0800 (PST) Received: by mail-lf1-f52.google.com with SMTP id l11so14369478lfg.0 for ; Sat, 19 Dec 2020 12:08:37 -0800 (PST) X-Received: by 2002:ac2:4987:: with SMTP id f7mr3561966lfl.41.1608408517290; Sat, 19 Dec 2020 12:08:37 -0800 (PST) MIME-Version: 1.0 References: <20201210150828.4b7pg5lx666r7l2u@black.fi.intel.com> <20201214160724.ewhjqoi32chheone@box> <20201216170703.o5lpsnjfmoj7f3ml@box> <20201217105409.2gacwgg7rco2ft3m@box> <20201218110400.yve45r3zsv7qgfa3@box> <20201219124103.w6isern3ywc7xbur@box> In-Reply-To: <20201219124103.w6isern3ywc7xbur@box> From: Linus Torvalds Date: Sat, 19 Dec 2020 12:08:21 -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: 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 Sat, Dec 19, 2020 at 4:41 AM Kirill A. Shutemov wrote: > > Okay, but we only win the NULL check. xas_retry() and xa_is_value() has to > be repeated in the beginning of the loop. Yeah. I wonder if it might make sense to have a "xas_next_entry_rcu()" function that does something like while ((entry = xas_next_entry(&xas, end)) != NULL) { if (xas_retry(entry) || xa_is_value(entry)) continue; return entry; } return NULL; but that's a question for Willy, and independent of this patch. I like the patch, and I'll think about it a bit more, but I might decide to just apply it to get this thing over with. Otherwise it should probably go into -mm for more testing. Linus