Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp759770ybh; Wed, 15 Jul 2020 14:38:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwASOvFyr1nCax9HzXAg4xlYF+gPxNC1nDBtsbJd7MtesslYVIbN7It8stxixj8/SWIs66d X-Received: by 2002:a05:6402:1d35:: with SMTP id dh21mr1654815edb.186.1594849129464; Wed, 15 Jul 2020 14:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594849129; cv=none; d=google.com; s=arc-20160816; b=ual5+H0A8ZlqbS2lWuVrniJrhcP+Wdor7mJRoPhMg/wLFo9zoArrdK7UDJBLcEXCGV iRjBWM2AN5yksChQnYt9VVMIv1GCX+3U5xibhlxnNcHoQaQMk/toUkpPhYrMxHIqXhAi eBw2gx8cE8lVLEXqUqmaHeZwdnPoc4jH64EbpNP5w8sfMasAeO++HHyWQ6M4C/UcQxYx UJ0Y+P2LBDz4zAd35VjbBchUCq+kX7X9q9GYhR3dm6yk9WWlCwOT+WqhFf8L18ERIIjJ 5xsyZO6RCykwky8P1c9VUh8xlVvrfTPcsndlhrLoJMozuH0KKskWjmuv+BmZ3JbzmfhY BYXA== 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=CjMxw3ResUXoWBbMIRKY+bPmsQ8ypTFl9rScDJBtLoo=; b=NIIU/3cdE7b7006LbBX4Oc79yXuRk+EJ/VNtA1fspZPnaqPfkNy96mjT5se2erpF78 efuXnyBQMQGIN4TvBe6bn8vb5GioE9jSo1k6T43XOBF/TLzEUgPMB4mZVfayMgfSyevV N7L6pRPghBhs/Pqiw06AgB/U4so2KifPblHfPVqczyyLBsiVe80O/jpIM7gMLNo31kPy VqJXPeyhWLvUwFotLpKkiQMqyFDqpaFmisBEse4lrxiYUnmz7CNP7KH7hcooIoWiu4o+ DtoQSp1px7ZeDjoOXd2RDPgbvQQ4hcTGeD0ycfdkpi6Lm5dJmq5kJpWum+iNQPJEDwDA X6Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=V+4l+Hox; 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 g21si2016580ejr.275.2020.07.15.14.38.26; Wed, 15 Jul 2020 14:38:49 -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=V+4l+Hox; 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 S1726977AbgGOVgG (ORCPT + 99 others); Wed, 15 Jul 2020 17:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbgGOVgG (ORCPT ); Wed, 15 Jul 2020 17:36:06 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9F1EC061755 for ; Wed, 15 Jul 2020 14:36:05 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id t9so1938656lfl.5 for ; Wed, 15 Jul 2020 14:36:05 -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=CjMxw3ResUXoWBbMIRKY+bPmsQ8ypTFl9rScDJBtLoo=; b=V+4l+HoxVX5Hl43um25q+wr17B2AXE1g7UXRgYNlhUnnY2Z9vjES3KDTtyn1rM6c50 QUiWBL4+QMAAOSr6z/7YpcDE3S0c62+9nXrvP6dw/1A+cvDOAlTEClWaRd5xWHrDKXLm nu/w4+Yjcm2hdeH9lNInhPbF1+W7Pzk3GVZXA= 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=CjMxw3ResUXoWBbMIRKY+bPmsQ8ypTFl9rScDJBtLoo=; b=D12rMPclHwZKFGA6nKfv1HSvCBp4Z7xDUWqurXH0RdarjWKlQaRLAVQH8FvuWXQutX CkGIhnFGeSHjg87lCkbmQ16KrgKNS0q8Jj7tMI3775hCcoUavfjJvWd1ddnLwjXw3/xt jxltbFhGrjL2HmPbGs6PlLnqbgvJeFDL45uyEzBq3DHl2wju2QSsWragp38YzJddLJFC 08+57bJYjpKSk1P7Kj+1wtPW286SQ4bDqoGa311+RmH1l3ZIycsdsQvv/f+kfRYsQT0l AhTJw/A5P9NwICJ7c/WKG+U1cMFY0vWyOMdgDsqVV3zkCz8JGYA4H/ZUhakYzxC2yj/X TjOw== X-Gm-Message-State: AOAM533phROtfDuHFdcTjnkKJSAYRYecRAMBM9jVHofVz0p6WRl/arlD 29sV8VKMJ/YBiFM7MzgOFm7V2G3+BlU= X-Received: by 2002:ac2:5296:: with SMTP id q22mr488889lfm.106.1594848963956; Wed, 15 Jul 2020 14:36:03 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id e12sm657046ljl.94.2020.07.15.14.36.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jul 2020 14:36:03 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id u25so1952525lfm.1 for ; Wed, 15 Jul 2020 14:36:02 -0700 (PDT) X-Received: by 2002:ac2:548a:: with SMTP id t10mr505514lfk.142.1594848962528; Wed, 15 Jul 2020 14:36:02 -0700 (PDT) MIME-Version: 1.0 References: <20200715135011.42743-1-kirill.shutemov@linux.intel.com> <20200715205508.3rzrkhulruzpy6iv@box> In-Reply-To: <20200715205508.3rzrkhulruzpy6iv@box> From: Linus Torvalds Date: Wed, 15 Jul 2020 14:35:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv2] mm: Fix warning in move_normal_pmd() To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Andrew Morton , Linux-MM , Linux Kernel Mailing List , Naresh Kamboju , Joel Fernandes , 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 Wed, Jul 15, 2020 at 1:55 PM Kirill A. Shutemov wrote: > > I don't understand 'len' calculation in try_to_align_end(). Yeah, Joel found the same thing. You don't understand it, because it's garbage. > BUT > > I *think* there's a bigger problem with the patch: > > For stack relocation case both VMAs are the same and always(?) the only > VMA around at the time. It means none of ADDR_BEFORE_PREV and > ADDR_AFTER_NEXT are going to stop us. But for the stack relocation case, that should actually be fine. We are moving the whole thing. Or maybe I missed something. > Consider the following case, before and after try_to_align_start(): > > before after > old_addr: 0x0123000 0x0000000 > new_addr: 0x1123000 0x1000000 > len: 0x1000000 0x1123000 That's the "move up" case that fundamentally doesn't work anyway because it will corrupt the data as it moves it. The stack relocation only moves down. Linus