Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2337700lqo; Mon, 13 May 2024 15:40:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeQpcEM2i7b5749WEeQh6dLxFLXdjWiJh7TcNT3YGE2PNHrEhz8Uc9xi3lPj3qSPUOs9FCtWXIwvjszJDlAKoqJcZ2/0KmKAcaZ9iP6Q== X-Google-Smtp-Source: AGHT+IEYGsGh444VuusDQ36PaiKvHoROcNaJkY4kMhjf3RY6HkHmahM9VYTSwOGd53G+5PyPdR58 X-Received: by 2002:a50:c055:0:b0:572:7926:a0f9 with SMTP id 4fb4d7f45d1cf-5734d6e056cmr6686533a12.41.1715640001651; Mon, 13 May 2024 15:40:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715640001; cv=pass; d=google.com; s=arc-20160816; b=0zkDp9JYzsfhwL5DPf+fB5pGVChyIHftx6cGN1Z7duiq+Yv54CEg4V3TiiaBod555V f+YOP0liU56yIz95cYdTU1ilRK0MjAeN1NYVFZJP2GERDh+KfCYgn785WDptuidDUZyH QxOSueCqw+O6/V9kjxOecZiG5rf/I86TBAHc8YWWeXW1S6dFPsePdU+UCWtzrDPJR8UE hzPhvsdwcIjZckghV0WhlFpxzQrjlPXOaG8vLUBDmvafDyfqhJpB7ow6+uVn6weW8M5P Iu9r0fGyND2S21cDuxdK0PEjBDAQMZsHbPAFXu3kMmqtJf0ThmG/2fMswMFO+cx+KEAN Pk2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=3PUBiVS+maEYXb1JMQrdGGPR2A1XvSRqUCOiD6UmFTE=; fh=TmToTfwQ9lNSTh20icaXRE3iN4kMoTmAwZKs56Ucnlc=; b=UhH/fzrGh29jvachV4VvTWO8lngQ1JO8EIighyiWM4Z8lGu811IUqCKw7fAt8xBevu vPItS7Pq3VuZxhl4nB3UFQcf4yP8kjoeM8z6dtlipQ1OgyJ8vIrACHtHaoHzNLwihNGM fwLla2PSeo40vqScZdJ0oMVq+K0k+39Cc+hFlbZAXIlNDnOkrGQ3LpfUwo+rveLFQhCb C7MNy7FIEGpXWckfkDLCtoe60FPScHv39nnz2C58XBlbimYhvPOt0OIbFA3phcGN404l gjAl1CkRB0LTapJDXlF3uSzuA41B9Q9d/dF2V/Cw3NUNikB7pXzAPSr70sJHJ8Np0A4/ mYaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gentwo.org header.s=default header.b=UrytV0QK; arc=pass (i=1 spf=pass spfdomain=gentwo.org dkim=pass dkdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-178146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gentwo.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 4fb4d7f45d1cf-5733c3628bbsi5545487a12.503.2024.05.13.15.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 15:40:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178146-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=@gentwo.org header.s=default header.b=UrytV0QK; arc=pass (i=1 spf=pass spfdomain=gentwo.org dkim=pass dkdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-178146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gentwo.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 61F551F229F1 for ; Mon, 13 May 2024 22:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51DE384D1F; Mon, 13 May 2024 22:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b="UrytV0QK" Received: from gentwo.org (gentwo.org [62.72.0.81]) (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 0383B134BC for ; Mon, 13 May 2024 22:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715639994; cv=none; b=J6VMRVJeqsEl93XQx9H8p5H+pF8NzDPIxJtUgqhM67FGMJb1DvbThr9+ETQhtHLD5wjBf+LKwqJ829QirH1DHp7xHOpF7I71wFGgtd1fVkgwKD3GOQ/3fSqBPYRkSg6LaqOXcYHKj8sSkjHbHPL1/S54pmZqDaBe84xJcmVGp7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715639994; c=relaxed/simple; bh=BSN7Xy3cGgTmiOR56jzKBdth2uyQ80MxzKLMljOx1AM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=VHZdisR/LZx/lqgekymNyK5QbnZbM1gwzc0jIiVc+eaLi10+1PwAoYgnJiN5tVbZiZeQB6CEygf4PO/VVjmM9fM+EhO9pK6F0IYOuSBTpsCe/ASUnukHIJjES4V2M50bj5wQRhlF1LjzjDgaT55kM8LnSp81f76Em0nWU6Kz/wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org; spf=pass smtp.mailfrom=gentwo.org; dkim=pass (1024-bit key) header.d=gentwo.org header.i=@gentwo.org header.b=UrytV0QK; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=gentwo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentwo.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.org; s=default; t=1715639986; bh=BSN7Xy3cGgTmiOR56jzKBdth2uyQ80MxzKLMljOx1AM=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=UrytV0QKWFlEdF+Hn8ySUdjdNjc7JvrK9YOERxx7rGXk68GXZs059H6agzVTj6mLr rrtXg3p5M0ENyH6WhUATfOY/fJecOYmF++Lx33NipqmDGsV1q+L+lg0gUa0BCVFe6S hIGrkMC/UdNWH9I5QvKGeYFWGtRx6ys4E8cGNy48= Received: by gentwo.org (Postfix, from userid 1003) id AE2A740A8F; Mon, 13 May 2024 15:39:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id AD19E4093E; Mon, 13 May 2024 15:39:46 -0700 (PDT) Date: Mon, 13 May 2024 15:39:46 -0700 (PDT) From: "Christoph Lameter (Ampere)" To: Anshuman Khandual cc: Yang Shi , catalin.marinas@arm.com, will@kernel.org, scott@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: mm: force write fault for atomic RMW instructions In-Reply-To: Message-ID: References: <20240507223558.3039562-1-yang@os.amperecomputing.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Thu, 9 May 2024, Anshuman Khandual wrote: > >>> Okay, I was about to ask, but is not calling get_user() for all data >>> read page faults increase the cost for a hot code path in general for >>> some potential savings for a very specific use case. Not sure if that >>> is worth the trade-off. >> >> The instruction is cache hot since it must be present in the cpu cache for the fault. So the overhead is minimal. >> > > But could not a pagefault_disable()-enable() window prevent concurring > page faults for the current process thus degrading its performance. The cpu is already executing a fault handler in kernel space. There cannot be an additional user space fault since we do not execute that code currently.