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=-4.1 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,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 8E8A8C433E0 for ; Thu, 16 Jul 2020 17:55:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4CBFE205CB for ; Thu, 16 Jul 2020 17:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ObQzTlhr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CBFE205CB 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 BAC206B002B; Thu, 16 Jul 2020 13:55:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B34526B002C; Thu, 16 Jul 2020 13:55:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D5806B002E; Thu, 16 Jul 2020 13:55:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 84FD56B002B for ; Thu, 16 Jul 2020 13:55:16 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2237637F1 for ; Thu, 16 Jul 2020 17:55:16 +0000 (UTC) X-FDA: 77044690632.30.art38_5b023da26f04 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id AC379180B31B7 for ; Thu, 16 Jul 2020 17:55:12 +0000 (UTC) X-HE-Tag: art38_5b023da26f04 X-Filterd-Recvd-Size: 5043 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jul 2020 17:55:12 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id x9so9115104ljc.5 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=fTntdsWf9kCyQLxkHrbmSL+7zT4Lp2n9we8O9HC9NIpNPxOfEvMtlt7MhiNj3/FgJm 8/UmtaC5UZXrI8Y1N5Qk2DomEKWg1MIbz2pDP66IMJbGq2KGtbC2x/xFpx35EOkVwC5v odscePEz39o9a3o8/UFQYLkHc2qllbmfiUduo79MbytD/jxT6ivWg6Vo24vWMcskbyBI HmDikBxfyamcoAxSPbfJng+9w6e6BCjXRL8K3DBnmODQHMUEUkfIQH4c5P+KuDc27YZn XahtxsbAp68XcFBaJgSI0csqFVjT/efSnatA74sZjb+QwQ9yWQrb22kS3sHP0MZYJNKJ azIw== X-Gm-Message-State: AOAM530UrC3jxhwTzKdSy0Uc3oOrIuiYoTTYM3SnTLi/dmqDRAvjXyVs bwec7DWJrGgSRLuOJReuZg4GO6zZsEE= X-Google-Smtp-Source: ABdhPJywANh4xu8tTd/m+1rN9A2Ej8y4vzAo9cdAtqH+JP2cCubPo90RzJ9Ze4mqC1q9d9XXicj9Jw== X-Received: by 2002:a2e:161a:: with SMTP id w26mr2643508ljd.216.1594922110257; 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 h26sm1176972ljb.78.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:09 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id d17so9163584ljl.3 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" X-Rspamd-Queue-Id: AC379180B31B7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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