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=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 0D594C433DF for ; Mon, 24 Aug 2020 08:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D585F2074D for ; Mon, 24 Aug 2020 08:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598256612; bh=7JOye7vDpDMYdETfHJcW3K54VhcBLd6sYJ9yFyD2qws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Upl8kYVt8J4LDOGgUOrknzgjP50yv2MUHOYhd/+AKODhYpqzSwZbxFXOFjKb3IIKb P/xcrD5UpUF02V1S2mexBtcHRg1a6ucQnKq1n4ymcuFpJdPRwxBKtgFBHEUwpTBDzT yzh4sCc96JP2MGO7C3VTm54pqDob651rCm9lCT54= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725926AbgHXIKM (ORCPT ); Mon, 24 Aug 2020 04:10:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:48022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgHXIKL (ORCPT ); Mon, 24 Aug 2020 04:10:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1F022072D; Mon, 24 Aug 2020 08:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598256611; bh=7JOye7vDpDMYdETfHJcW3K54VhcBLd6sYJ9yFyD2qws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=De9LWZHuWsLAcFoeUCfSO2UzZfws0sz0zjqGLjdsYEXItkjQLUxIlc5tOCwguRfiD UAiMo4m4pDizuJz5VpAoarWQ0729h9azbBO8550Kpm6m33WgkBcAjZmbCMYKKokwJS iRnrKm9eqaWRbD3+/k4eHoH/Ed61UJZ1BT2h5Z6s= Date: Mon, 24 Aug 2020 10:10:29 +0200 From: Greg KH To: Mike Kravetz Cc: peterx@redhat.com, aarcange@redhat.com, akpm@linux-foundation.org, stable@vger.kernel.org, torvalds@linux-foundation.org, willy@infradead.org Subject: Re: FAILED: patch "[PATCH] mm/hugetlb: fix calculation of" failed to apply to 4.4-stable tree Message-ID: <20200824081029.GA92813@kroah.com> References: <1597839685158224@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Aug 20, 2020 at 01:04:24PM -0700, Mike Kravetz wrote: > On 8/19/20 5:21 AM, gregkh@linuxfoundation.org wrote: > > > > The patch below does not apply to the 4.4-stable tree. > > If someone wants it applied there, or to any other stable or longterm > > tree, then please email the backport, including the original git commit > > id to . > > > > thanks, > > > > greg k-h > > >From d43b8a81c7f921aa52d55817390384053cd7be21 Mon Sep 17 00:00:00 2001 > From: Peter Xu > Date: Thu, 20 Aug 2020 10:38:02 -0700 > Subject: [PATCH] mm/hugetlb: fix calculation of > adjust_range_if_pmd_sharing_possible > > commit 75802ca66354a39ab8e35822747cd08b3384a99a upstream > > This is found by code observation only. > > Firstly, the worst case scenario should assume the whole range was covered > by pmd sharing. The old algorithm might not work as expected for ranges > like (1g-2m, 1g+2m), where the adjusted range should be (0, 1g+2m) but the > expected range should be (0, 2g). > > Since at it, remove the loop since it should not be required. With that, > the new code should be faster too when the invalidating range is huge. > > Mike said: > > : With range (1g-2m, 1g+2m) within a vma (0, 2g) the existing code will only > : adjust to (0, 1g+2m) which is incorrect. > : > : We should cc stable. The original reason for adjusting the range was to > : prevent data corruption (getting wrong page). Since the range is not > : always adjusted correctly, the potential for corruption still exists. > : > : However, I am fairly confident that adjust_range_if_pmd_sharing_possible > : is only gong to be called in two cases: > : > : 1) for a single page > : 2) for range == entire vma > : > : In those cases, the current code should produce the correct results. > : > : To be safe, let's just cc stable. > > Fixes: 017b1660df89 ("mm: migration: fix migration of huge PMD shared pages") > Signed-off-by: Peter Xu > Signed-off-by: Andrew Morton > Reviewed-by: Mike Kravetz > Cc: Andrea Arcangeli > Cc: Matthew Wilcox > Cc: > Link: http://lkml.kernel.org/r/20200730201636.74778-1-peterx@redhat.com > Signed-off-by: Linus Torvalds > Signed-off-by: Mike Kravetz > --- > mm/hugetlb.c | 25 +++++++++++-------------- Thanks for all of the backports, now queued up. greg k-h