Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4637209pxj; Wed, 12 May 2021 09:46:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEnFM4zVdaZFj8owALJmNrdIGHJAFx61Ooggh80OCmzUYcHZxgpsR3FO/0RmuGArJtjn4k X-Received: by 2002:a17:906:b0cb:: with SMTP id bk11mr39326589ejb.310.1620837982311; Wed, 12 May 2021 09:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837982; cv=none; d=google.com; s=arc-20160816; b=gLPb8kMiVWhOnMRDB2VFnpdvTHzNGJLqkEU2cSA28stP4YbrOd6WOA6egdSzzFzUXH rkJHrxp5gmOUZRhEvP50cUWukCtoCXTPPjFBWezp7yUrd0/Dc2V4MI4fM0T/r/pFp51a 9ve3xkCSSiWczR6+yMMaa7ddijyYzAaw/O/Js0xnMkH9hy+KyeLpHJWciY9c+zoLIiQV jbgupFjNa+vocWE9UXCnXIrQywOfLAjRVVYRicaP0JovUyxjB8yhtqcOJlrEGDHEGsi+ OQ1/Ty2gKq7pY8a+CkDvDwFkqLwqvWjsSoCbOT7aYdnWpVazNrneSk3TvlL/ALaoPuvk LIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X0OZVwmn7FSxDw8ygi+PfNNZAIlvyoI1GfcTw8XFWBw=; b=kEWXN6YUxm2eQvDjXKK+ME2ti2wz0pQ9N1im+wDdhvY8JQkwYRFiSPtEGcO/zgs6LF KaR/dBaMyJDgSXCLYeMhZbf2mk4EGXw58W7PgQXjbdIUnpnLtu3ZCSlYMU2YMxczcmQf 99SWLZV6CU9aPMB779o6R0Ox3dmfsrfCx0DfAN4RBwpNHr/ROBnnO7gjJ63oDRWqfn3R VFgsT56pxrXlJxCd8LiHGFZx4YEvrIGsFDk6ShTkOc5N2QnbdRX4WLQgh7WhQiMrc8uh kHP0bGOzX6ecWvcF6yZPmI+nuwyGS6Vgx9QaqlTf+NcBrmVcDudVEbLaYK0IP/y4hY9u cREA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NrgRkAYm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o25si292518ejh.443.2021.05.12.09.45.58; Wed, 12 May 2021 09:46:22 -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=@linuxfoundation.org header.s=korg header.b=NrgRkAYm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234308AbhELQoJ (ORCPT + 99 others); Wed, 12 May 2021 12:44:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:50360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237028AbhELPrx (ORCPT ); Wed, 12 May 2021 11:47:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8940A61CAB; Wed, 12 May 2021 15:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833065; bh=FNpzwkVIAE7Nv7rJBYCN/NnDjABYNXOuylGnDs2pnds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NrgRkAYma7NS7xWCztq8luXsMbGiFlfQhSnzzQfE3WkYRB6T0MctjYTLUnR04o+In 48tIaIeUnrAeBApbPhOVhsKUAnPGEoaC3gforGbgzc8JU96Bq2DNv4sxE2/DYFubSd J1umaT4EGtbpyxl2aVUhrsemuleDfhyGlEhNNjy4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jane Chu , Dan Williams , Naoya Horiguchi , Dave Jiang , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 521/530] mm/memory-failure: unnecessary amount of unmapping Date: Wed, 12 May 2021 16:50:31 +0200 Message-Id: <20210512144836.876077682@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jane Chu [ Upstream commit 4d75136be8bf3ae01b0bc3e725b2cdc921e103bd ] It appears that unmap_mapping_range() actually takes a 'size' as its third argument rather than a location, the current calling fashion causes unnecessary amount of unmapping to occur. Link: https://lkml.kernel.org/r/20210420002821.2749748-1-jane.chu@oracle.com Fixes: 6100e34b2526e ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages") Signed-off-by: Jane Chu Reviewed-by: Dan Williams Reviewed-by: Naoya Horiguchi Cc: Dave Jiang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 570a20b42561..2d7a667f8e60 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1293,7 +1293,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, * communicated in siginfo, see kill_proc() */ start = (page->index << PAGE_SHIFT) & ~(size - 1); - unmap_mapping_range(page->mapping, start, start + size, 0); + unmap_mapping_range(page->mapping, start, size, 0); } kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags); rc = 0; -- 2.30.2