Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1613782pxa; Sun, 2 Aug 2020 14:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2ONhYIt7Uq8tGnUPbx69o2tItvY/XiotQtjWBovl6kbzcO5SlP/Sj651DfyOiRkG3FRZr X-Received: by 2002:aa7:d596:: with SMTP id r22mr13270699edq.204.1596402589904; Sun, 02 Aug 2020 14:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596402589; cv=none; d=google.com; s=arc-20160816; b=MlMlAQnVBhe/tn2Yv9YpRtwG/GZNnKRXLHvSa/jF0O4tJ6x0ewQmPPOUF3cZEiWJjJ 7OL++brqq0DT4UO63tC3uweD2kmpA0vFp8osPDdDmoHlIWoOb+36j/tYhcHJ6dFFL56W QfuD5ouFYqcQv6K+vaJgE/fgMme7ioyRsy+uBXWSCZy0eeBBdTIYFFy5wFVqQE4jhOoc mOhWR5thWVBcGcElpix4rtoVod5PMH8qSA7ZY/fkri/s57T1JSZ/n/LfjIPwPRgPF5wv IKb2p/SOmv/QqrGWbhZuwtbqPGrXVBooK7FwI3SgV1xCfsB89yxKIRzvTK2EeoMcqnWq 79QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Br9WBHvsc6w7gfIRxLUPjWIrrFDRQfIjkhX5MpKC26I=; b=e7MIoIs1IkxLDu/Nq6Gx20/HlX+ZFOTKkIV/l7Q8mW2ovkNMsoHvgg84RG3jZOTboc fbB8xagc0Ug++LuV55oMeRkzD/tY1GFovZ6+mvhMfN82h9xLxnYCC5tN+WQzeCYNxAgk UNafwM+UPFv9W93Kon9XwByTNESyhFRtnqMNdIao+EZa5Hj4ISRfeLlHCxzGYyDPvH14 RFo7rIvlDzxk5I6vyGtQnauAAhWCmRZ9DryIcGunJXYNbRWm7qtZvE/Zz333QkZ2m4OY frdxQv4Q22z/mBDI2NW0+ij3GKtQFGcpmyC8wz/VF7sZL3ZGGyI8CuN7zEqaVwnwX4HW hD4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=TGrwu8PF; 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 i28si10686341edj.373.2020.08.02.14.09.27; Sun, 02 Aug 2020 14:09: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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=TGrwu8PF; 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 S1727101AbgHBVHf (ORCPT + 99 others); Sun, 2 Aug 2020 17:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgHBVHe (ORCPT ); Sun, 2 Aug 2020 17:07:34 -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 6CD1CC06174A for ; Sun, 2 Aug 2020 14:07:34 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id i19so19422095lfj.8 for ; Sun, 02 Aug 2020 14:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Br9WBHvsc6w7gfIRxLUPjWIrrFDRQfIjkhX5MpKC26I=; b=TGrwu8PFTt5ADvHUupXm43txcdcj/MOTw3/GG2N+j55vWLHExqdPSEiBM6m/9/qeqq iMu1Po+7/ghlQCw4RyC+FrQDs+PfS+FuMeSY82MkpANZ2pbi6mJlz+3lGrDhunt5fd6y XIi6GaGbSy3jb66H7E/DK2GOnjUZjZPkx5Aj/5ukL+Cb2OnLmPVU9EQUTDr+qzKpuxnN nmjfXsO9R6r+JlHblMLt0qmwH3W9UOmEE6/ZeLpt9PJXIWzGNTZP96Vk48y3MQWLEfro eQ0Z8kQA8f99wIG8rdUvGAZg+6kDLtVeEctGPAqo2NCqeXcWF7ocxCn+eLVMnR/6ROOG K1Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Br9WBHvsc6w7gfIRxLUPjWIrrFDRQfIjkhX5MpKC26I=; b=e+vCxbVUcMHWzx5bVbt16EiBsovZO1Pg9BQCaS9NzF7WZf5BOcalMpqRJJltYFHJ0A qDuaqS9s7c1Um/1CfWREZw1ScQg1WMqTc7JVbKod9oP7L+faLyaByz2YOxGIhcOgFnFn dI7WxcgN4rrugSjMPnCNJXm5IpX4J7n2x7y93ZEIGD/okBVm5JnLjGNBUJ5R++A/a12q J8aicUZXsiZBpFvY3Wo8qvJPDubpktUOiR4bYtGx2nOU0BUcJ1eWw+OuRq01tXUrC0Kk eT1gFgCxrS5x2AXdA8Pvh+d8Spcf4JHBNJcyUN491DNnm8RQ7c1pqjtzYa1JXE4lbqUd 8tKw== X-Gm-Message-State: AOAM533FhcCqtN7ETCfwCR6LuN1NNRL8R709D97gGAE3+xLq8YyvFQ1x y6YhJLad0bljaous3aEcAIp+rg== X-Received: by 2002:a19:228a:: with SMTP id i132mr6800287lfi.178.1596402452874; Sun, 02 Aug 2020 14:07:32 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id u5sm3944730lfr.3.2020.08.02.14.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 14:07:32 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id C63CE102BA1; Mon, 3 Aug 2020 00:07:38 +0300 (+03) Date: Mon, 3 Aug 2020 00:07:38 +0300 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Song Liu , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] khugepaged: collapse_pte_mapped_thp() flush the right range Message-ID: <20200802210738.i4trrpq5b77yaxzw@box> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 02, 2020 at 12:12:42PM -0700, Hugh Dickins wrote: > pmdp_collapse_flush() should be given the start address at which the huge > page is mapped, haddr: it was given addr, which at that point has been > used as a local variable, incremented to the end address of the extent. > > Found by source inspection while chasing a hugepage locking bug, which > I then could not explain by this. At first I thought this was very bad; > then saw that all of the page translations that were not flushed would > actually still point to the right pages afterwards, so harmless; then > realized that I know nothing of how different architectures and models > cache intermediate paging structures, so maybe it matters after all - > particularly since the page table concerned is immediately freed. > > Much easier to fix than to think about. > > Fixes: 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP") > Signed-off-by: Hugh Dickins > Cc: stable@vger.kernel.org # v5.4+ Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov