Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1849958lql; Wed, 13 Mar 2024 09:46:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiECh3uxeJfqQHB4JuTLoy/ADRpfhhJ7CmR80OJd0aeaRfe+WCkBIKXLLX3T79Lpe0jefTiPYXWTxRxWab/FYElhV/RdNvRzhzpw2N6g== X-Google-Smtp-Source: AGHT+IHPkud2cvySFmMNDDooFgMci2AVUAglVId2vhSgM3JWBcTSFPj/Cm4lMxsGvcmCEYwuMCaS X-Received: by 2002:a17:907:8906:b0:a46:2754:dbc2 with SMTP id rs6-20020a170907890600b00a462754dbc2mr5529410ejc.14.1710348407451; Wed, 13 Mar 2024 09:46:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348407; cv=pass; d=google.com; s=arc-20160816; b=wip6rVaHwaoRXQQFIQ6uWJ8xkigqh1YF4Qy7xRYucYvI7pMeD20wjHZNCVf9YnPHWJ uSaIQFomFUd6WF8Ap0y8Vj5nXJygtXh8PZ0e9LRFamEnEzkMwsKjwXeoywgZR3apBxTo /wYLCyW2bKfw9+WmHIbpnOCjvMI0d6gFg4mdpfLjxqc7chAY/RgnM32mBYaGKzU/Y2g5 H7AE8j3zphkcrxrTEa8ZyoaVQoTVDT9LBAHrbWQUsxsZTvrNwEiWfI54t84zLxykF+hz KyhbhmTgE6JD6idHTqtgPqfAvRrOeoqzW5TFaCpL3syUdjUKOZDFpmPe29fLE+BvowfB KL6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=P0XG1TnGZ2h39imsUj0Unij5BCp/8Txb9hH8WS8oWAY=; fh=/IrKKCjfYUwg0iQpTbCp96OmvaOxZgPL9KDqSvRZrvg=; b=ZXMcrqqyoGFVvlFBTYdi3t9M9D8DDgpv+2cE/7DPG8pgLKK42Ae4GHbNHK1FChmZzO TRTDtw+U6tl9+3hw0tXiA+ai5NfyBHl8nntPMM0Gy+49VZkNqdtW9MFKAK9VJ3YB6RQx Oxwuf7PirPW1USBQuMVjKxkscfXQnlu+B4JhgHk9m755DUnfxZp+QspH9SwJsYwxuehx mkoY+XUbJU09zpqbUOf7j/iM9/mwX9oGBhSADBSe3DYxkXlRZVOr78EHyx5a1QRUmALf olcTEVEjMYrVbw5SgEODfTTIXoaHfArS4VP+YtijnKr8xaL9EQkEq0AfNROlZvaag+nz K24g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udLwGm1H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lg18-20020a170906f89200b00a4649c860b4si1392377ejb.1041.2024.03.13.09.46.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:46:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udLwGm1H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2F91C1F231F2 for ; Wed, 13 Mar 2024 16:46:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E716E67C68; Wed, 13 Mar 2024 16:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="udLwGm1H" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B41267C49; Wed, 13 Mar 2024 16:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347656; cv=none; b=kHbLLcxr9umVFWQdJ/2zaWAyFnGlIveKJalSuxvwOeMQtuh9uEGEhjxibKA57vjJh0RPCrj/uF/WdlrbE+34KlP713NyKUKDoaOZewdSkt7X9zGu5WJXaUNTnyQQpUr6yf9KUHRf5MOqy3bP1cJyz4eb+H5mWn4XRWSEBSPM5cI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347656; c=relaxed/simple; bh=Qaj5IwduPnsQ07HAtin4ZncLH0Y0BKw4SqhUzih49pY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=egoLtJnmghHWe+bF1AniE4q3cMwogLs9JCYLYsaNg4eEt90J0fbQaO3XOYBHRzK+SUV3ZjuZ1qpFO3Ff/ajgMC1Q4X2JXtOOm/meV2MIgjLZ1DzDcqbqv0eli3u1lvFa+CbvKyx65Iits+ZlWNt8P1WTQFTj9tRNCJZQG7MIG08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=udLwGm1H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BF1CC43394; Wed, 13 Mar 2024 16:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347655; bh=Qaj5IwduPnsQ07HAtin4ZncLH0Y0BKw4SqhUzih49pY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udLwGm1H6AZwHSY3vKZ1sppmOXcRVDQNYuTXvxYMBKsgh3Q/zHWTVQWVD5wMpA3dq ukbkDWMoGjkWWpK2rqpUCJ3TBE5vMjMvo+af/UZv3jAGbfRocuuMFmj1Bo0Hdb/33j fGi8Cf+Yk6sdqzGQcEAaCCYyg+QwmqOlON6bQ/jVNwMobsn0RrjmRPAP/iGvXE9o42 HcMvA8r5Pb1t6WWwAwZ26jQKFs6WokbqWLcMHWlG262IL41cTMdubnrgyd+HfaxF6E UOH9U8OTEdpHEeLlzeE+C8WsTTajW3PJxSuaiKael4D69MWTNMwB91EURBFBdVj/oI hcYaaj/zZlhBQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Suren Baghdasaryan , Russell King , Alexander Gordeev , Andy Lutomirski , Catalin Marinas , Christophe Leroy , Dave Hansen , Gerald Schaefer , Matthew Wilcox , Michael Ellerman , Palmer Dabbelt , Peter Zijlstra , Will Deacon , Andrew Morton , Sasha Levin Subject: [PATCH 6.7 60/61] arch/arm/mm: fix major fault accounting when retrying under per-VMA lock Date: Wed, 13 Mar 2024 12:32:35 -0400 Message-ID: <20240313163236.613880-61-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Suren Baghdasaryan [ Upstream commit e870920bbe68e52335a4c31a059e6af6a9a59dbb ] The change [1] missed ARM architecture when fixing major fault accounting for page fault retry under per-VMA lock. The user-visible effects is that it restores correct major fault accounting that was broken after [2] was merged in 6.7 kernel. The more detailed description is in [3] and this patch simply adds the same fix to ARM architecture which I missed in [3]. Add missing code to fix ARM architecture fault accounting. [1] 46e714c729c8 ("arch/mm/fault: fix major fault accounting when retrying under per-VMA lock") [2] https://lore.kernel.org/all/20231006195318.4087158-6-willy@infradead.org/ [3] https://lore.kernel.org/all/20231226214610.109282-1-surenb@google.com/ Link: https://lkml.kernel.org/r/20240123064305.2829244-1-surenb@google.com Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock") Reported-by: Russell King (Oracle) Signed-off-by: Suren Baghdasaryan Cc: Alexander Gordeev Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Christophe Leroy Cc: Dave Hansen Cc: Gerald Schaefer Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Will Deacon Cc: Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- arch/arm/mm/fault.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index e96fb40b9cc32..07565b593ed68 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -298,6 +298,8 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) goto done; } count_vm_vma_lock_event(VMA_LOCK_RETRY); + if (fault & VM_FAULT_MAJOR) + flags |= FAULT_FLAG_TRIED; /* Quick path to respond to signals */ if (fault_signal_pending(fault, regs)) { -- 2.43.0