Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1397460ybh; Thu, 16 Jul 2020 10:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq+0IqSIakXJ/yStYcGpmU6DXZcFrYK+/eJvHFid6P5Ya5Tj1xALlYrOhHm0D+LWeMpSMq X-Received: by 2002:a17:906:9716:: with SMTP id k22mr4897330ejx.200.1594922282283; Thu, 16 Jul 2020 10:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594922282; cv=none; d=google.com; s=arc-20160816; b=icokv2XSlD3S44342rD7ksNpR5GJAS7X1BMXYr7vnQsL43hawt7tg33XPrmU8p9equ 4RRrbeqbsXvmVffsX5YJu8OY4uZyFOCN8eUEO/HV2pK9PwFo+5sTQrRLTSzSm8xGM9/w tZzWviaHYZNDrEKK0gRBsOtBGDfr0SeUaeKYbfD/MlVEjc2NdSB3VmknW/oF/1uDsYCX Dfocc4esGWp3efLQSorrofVZf/u8GPmdYalkstsULooOvid5KnBiDkKSIthn8NGgb+8p zRZ5WjGMY1wmch+6+qqIci6Tcg1i1Z+18vZCXhdo426EUFFK8sfUPeYV8EZ99gBiye5F yshw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Xq2JH4o8fhssULM8OxiE+8BVwjY6u3DAco48q1luJAA=; b=HoBVY0IzJoC1+e64Yt+eXdFkQ5WqpBYnGLyXV28H15/tTJ1t0PZHRGclwnme07EaE6 Vnz97XgDda8eLGfztUJBnfId2BiPTWW/47WD91PxvQpIec//yDD+OFDOhPIs1XmbcQpO djYIQYWoJ54kuAKg9VXDBSL8RncoYBZAGz1AurLegKXnB82Essj+PhtZmdybycl6SLIP YXyhe8byTB3y0tyemZFKmZFdk1IR2VUQWxSm3r84Iz6LCmK3Js8FSwslKH3oi/CjoyaS fLnprrnFVfPKnFZKCFeHIK0qnCPS0eTIyTbMVcvADizxVTmWza+3Dw0g1WcB98tC3NDW QiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ObQzTlhr; 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 r5si3728258edh.198.2020.07.16.10.57.39; Thu, 16 Jul 2020 10:58:02 -0700 (PDT) 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=ObQzTlhr; 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 S1728412AbgGPRzN (ORCPT + 99 others); Thu, 16 Jul 2020 13:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727844AbgGPRzM (ORCPT ); Thu, 16 Jul 2020 13:55:12 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AC5BC061755 for ; Thu, 16 Jul 2020 10:55:12 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id u25so4309809lfm.1 for ; Thu, 16 Jul 2020 10:55:11 -0700 (PDT) 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=Xq2JH4o8fhssULM8OxiE+8BVwjY6u3DAco48q1luJAA=; b=ObQzTlhrDJzFPiBqNrDCENTQ8eDuKme5lbe0pge63Qy9tUEn0lpb9Ibc70CsMa5rJp w8lsRsux3WCKeRWxpK6T76ywqmXf6GOGmCHC3Y9Ch4w0CY3EGTy5ho0T+peufUbLOykN oxttWek9XqXN20xjMRBA6JbA31+SDZptabSZQ= 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=Xq2JH4o8fhssULM8OxiE+8BVwjY6u3DAco48q1luJAA=; b=Kdi0kXE/zjyvxz7sG/s4rPXIXm+0xeKBogzjVyUodMaUgk4v/ILTVhxg3ZIMy6mplo wHP7/fPXaq92pJkmZG1kEiB/FZPYW2hBM/EI8GMKx6+QQuRSRNyCtoBdgpC2nA2JDmvl cnrWhip7gX6tKju4XYVarmqLh0A/lNqS7nAOYCGSkXQij4uoxKbRzN53XBbuZu7kzDAY VbFBL7wF7ehZt0EqD900iYahfnO7bvlJg7sEx8hCgiKla+3YGz3pJC96fLZbLxhkaA1S mz8RpsU4EZMe8Z+X2a+vzecHM2Vzz9kalXoml6BI/CZtiYmsQvtf7aBEIINyWHlzgQkR IEfg== X-Gm-Message-State: AOAM5336TWqnrm7aZrD0F5MgzjRQLR4BPvNM+MK2I4BcPFwe84JYCHTe 9GyTz7pf3JEbp2HldnZOL0zmfS/tMwY= X-Received: by 2002:a19:ca48:: with SMTP id h8mr2745889lfj.161.1594922110206; Thu, 16 Jul 2020 10:55:10 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id l4sm1176259ljc.83.2020.07.16.10.55.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jul 2020 10:55:08 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id x9so9114754ljc.5 for ; Thu, 16 Jul 2020 10:55:08 -0700 (PDT) X-Received: by 2002:a2e:9b42:: with SMTP id o2mr2516849ljj.102.1594922108423; Thu, 16 Jul 2020 10:55:08 -0700 (PDT) MIME-Version: 1.0 References: <20200715135011.42743-1-kirill.shutemov@linux.intel.com> <20200715205428.GA201569@google.com> <20200715222228.jf2pv5u2wyhtc5o5@box> <20200716131612.b7ottczdgnxwdvrp@box> In-Reply-To: <20200716131612.b7ottczdgnxwdvrp@box> From: Linus Torvalds Date: Thu, 16 Jul 2020 10:54:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv2] mm: Fix warning in move_normal_pmd() To: "Kirill A. Shutemov" Cc: Joel Fernandes , "Kirill A. Shutemov" , Andrew Morton , Linux-MM , Linux Kernel Mailing List , Naresh Kamboju , William Kucharski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 6:16 AM Kirill A. Shutemov wrote: > > It can also lead to performance regression: for small mremap() if only one > side of the range got aligned and there's no PMD_SIZE range to move, > kernel will still iterate over PTEs, but it would need to handle more > pte_none()s than without the patch. Ack, I've dropped the patch from my queue of experiments, because it doesn't work for the case I wanted to do, and the other cases could regress, as you say. Plus considering how many problems that patch had, I decided it wasn't as simple as I initially thought it would be anyway ;) Joel - while it's gone from my mind, if you're still interested in this, maybe you can do something _similar_ that patch, except perhaps also start out checking that the initial size is large enough for this to make sense even when one of the sides doesn't align, for example. (It might be as simple as checking that the initial 'len' is at least PMD_SIZE - then you're guaranteed that whichever side gets aligned, it's not doing extra work because the other side didn't). Linus