Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp295738rdb; Mon, 22 Jan 2024 22:45:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6m9WewywVU0EFz1DmLd9yTZ7Q0IFM1P1uDARznvTMftiGwR6Uthi923Xv7eshUdSzvfjV X-Received: by 2002:a05:6a20:8f01:b0:19c:4c51:6588 with SMTP id b1-20020a056a208f0100b0019c4c516588mr2261751pzk.77.1705992346619; Mon, 22 Jan 2024 22:45:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705992346; cv=pass; d=google.com; s=arc-20160816; b=hqcbcADm+bYD0XGMZZ+K6wmq/K/+FVtRNAxlHWCyNmdQTNUAB9MPSk9d1X2K04TLp3 8/ZgMr+fbQeZIMYw8dNTb0yLWyoWA534VQpAnY6R9hWP2C8zSne34WGHyDhUS2CPukBA ube+diAfdSYPbW+IPxUX3e+wV/kp/CziEYF7cTpRErBrMJLQE7Nv2OmDa1vUqZmqw/S3 +AyHfX0f+nZIuFmYxxB7SHeIUhSZ5nMfcRjb5vhtr9Hvg3Yd8bbUAP2gDYogF2VI9cTe oj0H8+0zKKa+VB0bTxOkTQaWBAeIp91FHomGPCN1HVdNQj8D/J4Mx8Z7AIPBJFoohtdt W/cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=PoTQEe2OLzexfh/hP6idvwNfJdYn+1MZAqnZalpJe8M=; fh=SZf/lZPhvtn/1kzkuJT094ZDa30Nu4WyzP5OjaXKm+I=; b=O46CwVtqPWw1wCt512wcRYu0MBFmw2rvCM6AL4m/siqOoaw4qVHuTMt7YjyMAjBzhs bGa2jUqcXmG9tyuQ/tU95igw2unnRom3HMMQ/GJNOOBDSSlTSd8GbB7YlRcZ3ZKqu4Ht 9xbcgGkB3eLaZWjK99f7nB9YmNdkCCbb8QCvZOvxw1Mio+N8FVM+jpIglGHYSsk+Uwvi dq91amtpLp3iaIr4IqQErniqcIocKCxMQwm9trIhrojhgMCSuVCLPzcBAs6f6mf9b4rb OwcwVMQVyn7nc1MFfQTqiuoerdfXK+TTihZxxzehCS+mslZMFahnWRYbd80J8g6R7dbj qVrg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2VOooJ6E; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-34804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a11-20020a170902eccb00b001d5c0d3f5d1si9581663plh.395.2024.01.22.22.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2VOooJ6E; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-34804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4094F286104 for ; Tue, 23 Jan 2024 06:45:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3EA551010; Tue, 23 Jan 2024 06:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2VOooJ6E" Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 662FF50263 for ; Tue, 23 Jan 2024 06:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705992338; cv=none; b=B+HbvPqz4Y/ovroPjQg8rGUKpRFOvGPjZ6EbZgTbQenvuNWCwAabGY9LNO5h20NRvE+p/Fty1ZhNK02WN19Bzb4a9F48Kg6CVKxAlpfFFIO9rnvalCp7IicfHoJrgAfOo1Vso5d7LyLWNldhnEpZ3/xYPqWo0rSG1hZmkh9P4/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705992338; c=relaxed/simple; bh=t/tQhqebbJMtWe/6w66DZ1En16T5xwr2Nkyq3Ik6suU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RuGLP1YBdrng9mh/ahMm+gfY9EWZmRKdfJVxsSJEljjMcXbFLmLuwZdRNFyR8zQgBvZp9+0upno2fjJaYpkL9GRpoEsyJ7Z7OjMcCXqf0urr+sGtYCtwED0LU9HWf0vBkEovxyeK6SXaP0tRs3eExUSOA3HbMeqV0ckoTsLcfno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2VOooJ6E; arc=none smtp.client-ip=209.85.128.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-5ffe7e7b7b3so16887947b3.3 for ; Mon, 22 Jan 2024 22:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705992336; x=1706597136; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PoTQEe2OLzexfh/hP6idvwNfJdYn+1MZAqnZalpJe8M=; b=2VOooJ6EcUCx5pm0KE2TqQWKNMyWHeA0Xo6lW6zHPOn9KEawo2dmbUs9jcCH6/ywbg wL1WPNOeCHnVK3r0+lBdg1wdAivNnaFaXI7JzAcw3fg36SJMhG8t1I4BZ2sMvCwYnSME f18rQO7hxspvPSjmNC6MO5kapVorHn6wT4OubUvZ/QRzVCRXuEQxvmzwHlApzognYDeP /RGIdmjlm/4M/MUR11B22zCrcJWWLsmg8p/LxlDK0HZyEln4WGarjckOAv/2S1MnTQyU SOLJtm63HEFgKiUYiVAE8KEmsbqRKc4EVU7cu3rTzZvgD3XytBJ73rCvw58nrcJeqWSr ZQ9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705992336; x=1706597136; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PoTQEe2OLzexfh/hP6idvwNfJdYn+1MZAqnZalpJe8M=; b=MOjaoNZDKeyNMPFS1QvEc4tACz6A1xuBt8KetswokLQpEqGVU0vqpeqJVruoIoahIy 5jIGkLCiOihu7ZlyDGV5VYe4uO82/6G0E/2Ymwu90y5TxF3Ene8Itp0ze5M/ZngBNjwj 8vXZ8KFDCxhCdOhmKCUchvBtdWSa8GEWhD7SssetDE9H8CsBgrZdrs7O9Nr0srF/ClKu Q2cgVU9zc73Ehzem7P/WDlS+e1P5dYj2UA/RJrwzwSPM1fJwDoyU8USpXDn4SAMfO/Ri RBT/z+HLiwqgYPZwrjzEvX1tc/56Bst7MSAae8XpRddllg9RwRFmX/89MA0PVTlHe7Z/ E0HA== X-Gm-Message-State: AOJu0YzETFIhnN/Ku4imjJwkRBpibR826haANPoHZnaiPirBB9nzP9dC om28eoeRIRDNQj7OAvE16FOViTHrpPbUYrk21uO1NgcWqg5n7sVGJjFb388mEg7SyWrp2z8n+lu flsQ+jExRRvKVq7PjV8Lv7y3/hO1mOkwgnsli X-Received: by 2002:a81:a090:0:b0:5ff:ae75:fe6f with SMTP id x138-20020a81a090000000b005ffae75fe6fmr3254872ywg.44.1705992336083; Mon, 22 Jan 2024 22:45:36 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231226214610.109282-1-surenb@google.com> <170578498755.24348.16166096320323933297.git-patchwork-notify@kernel.org> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 22 Jan 2024 22:45:25 -0800 Message-ID: Subject: Re: [PATCH 1/1] arch/mm/fault: fix major fault accounting when retrying under per-VMA lock To: "Russell King (Oracle)" Cc: patchwork-bot+linux-riscv@kernel.org, linux-riscv@lists.infradead.org, akpm@linux-foundation.org, willy@infradead.org, will@kernel.org, catalin.marinas@arm.com, palmer@dabbelt.com, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, agordeev@linux.ibm.com, gerald.schaefer@linux.ibm.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 21, 2024 at 11:38=E2=80=AFPM Suren Baghdasaryan wrote: > > On Sat, Jan 20, 2024 at 1:15=E2=80=AFPM Russell King (Oracle) > wrote: > > > > On Sat, Jan 20, 2024 at 09:09:47PM +0000, patchwork-bot+linux-riscv@ker= nel.org wrote: > > > Hello: > > > > > > This patch was applied to riscv/linux.git (fixes) > > > by Andrew Morton : > > > > > > On Tue, 26 Dec 2023 13:46:10 -0800 you wrote: > > > > A test [1] in Android test suite started failing after [2] was merg= ed. > > > > It turns out that after handling a major fault under per-VMA lock, = the > > > > process major fault counter does not register that fault as major. > > > > Before [2] read faults would be done under mmap_lock, in which case > > > > FAULT_FLAG_TRIED flag is set before retrying. That in turn causes > > > > mm_account_fault() to account the fault as major once retry complet= es. > > > > With per-VMA locks we often retry because a fault can't be handled > > > > without locking the whole mm using mmap_lock. Therefore such retrie= s > > > > do not set FAULT_FLAG_TRIED flag. This logic does not work after [2= ] > > > > because we can now handle read major faults under per-VMA lock and > > > > upon retry the fact there was a major fault gets lost. Fix this by > > > > setting FAULT_FLAG_TRIED after retrying under per-VMA lock if > > > > VM_FAULT_MAJOR was returned. Ideally we would use an additional > > > > VM_FAULT bit to indicate the reason for the retry (could not handle > > > > under per-VMA lock vs other reason) but this simpler solution seems > > > > to work, so keeping it simple. > > > > > > > > [...] > > > > > > Here is the summary with links: > > > - [1/1] arch/mm/fault: fix major fault accounting when retrying und= er per-VMA lock > > > https://git.kernel.org/riscv/c/46e714c729c8 > > > > > > You are awesome, thank you! > > > > Now that 32-bit ARM has support for the per-VMA lock, does that also > > need to be patched? > > Yes, I think so. I missed the ARM32 change that added support for > per-VMA locks. Will post a similar patch for it tomorrow. Fix for ARM posted at https://lore.kernel.org/all/20240123064305.2829244-1-surenb@google.com/ > Thanks, > Suren. > > > > > -- > > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!