Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1446100lqp; Mon, 15 Apr 2024 06:56:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDPCEHlj8zYblc0LlpOf3MxFSRrcmDCKrZw1huuKYKO/DotYvUwLK1jAzmaWNKu4t6c9Ldqe4nySTHjWBGB+xwc7qlim+JnFp4CJm4PA== X-Google-Smtp-Source: AGHT+IHw+pG5pct7UcQ5lZimqb+XcDS1uP7UwEYIYTXiHep00mlsmf475/wz3qQLVaeWotLWJXno X-Received: by 2002:a05:6e02:188c:b0:369:f021:5a5 with SMTP id o12-20020a056e02188c00b00369f02105a5mr14195924ilu.3.1713189399298; Mon, 15 Apr 2024 06:56:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713189399; cv=pass; d=google.com; s=arc-20160816; b=CzG0MqI1M2GEF5Xp2mj6rBnUrn6Co4NVDs7gb2qOHMfdm7hrPSrLdIwWkR0vQpO8+K qh8OUNb4n0yrXNghaT652BbpatG4ez31JaGJTvKE1PODvjj6lhKoV3AlnRNp8bRlCZs/ s2G5atppF9KNElylgDjnck/2hzgG233nT5abRHZ1aj87tGvczjC/YzppUJcvTDSzd532 x58mFcpDHKc8JNWJXvzMSWRFG5sj9KMYnr3snRUKYoyIhRQwxWDIqEUvVrKueR3NlIPs SYBg6pFmFKGTGYgWeU3NqRZVfqeAwdTeKW85/3VLnqgIGUAb+KLOlBRYub9hdZfEw+m6 EQMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Odozy2BLDSJ3flfmqEEsFw+Lc+xUdGcL/TjOYgEXfpE=; fh=9KL1C2W+ojz26YwhjALunWWfFbKSiQRNsuViWBCrbI0=; b=VBWhEr0LwjePIyHtb8B5riLf1bxGWuaBi5AMYespAYZyAnlurv92THt8kWfLdYprw9 WmCizcgpZWO8VKrpaP7yhyruvmAHa/DFtYbR0hWCya5+M5ZdLvLnLe52ufCVnFJ1eV1R s+DXhB3T+stV4HCBjGuIMG1DLBOc83z+g+dUd14pwNci1kDlSJCuv94NLWY7M6lcdqJO NuRblYBPeO1VlOmm9OWMst4mT+VcPwB17Fwr0pPOAlJeWnBJCaNF0ML14i1PteAPOPCd w5G4ZSv3kvUrNuZQPHwgXT5F+wsPtUbmJx3v0ynVsrsemeg8JMkpKTNCyoe3cg3h+8SS 4H+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hZFeOpk6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-145268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y26-20020a637d1a000000b005dc425a94d9si7700474pgc.369.2024.04.15.06.56.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hZFeOpk6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-145268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145268-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 539B5B20B57 for ; Mon, 15 Apr 2024 13:39:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA7D27E0F4; Mon, 15 Apr 2024 13:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hZFeOpk6" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 28B7878C6F for ; Mon, 15 Apr 2024 13:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713187898; cv=none; b=rH7n9xcGXjlC2xvNPbNrECYekpWc9gVwMfBwcdpORK3I8a2EpGEMTo6rYf5HKCDlqoF+FTRsBDaBelryfuNeHwSS3CvbN59ce2925NelIo0e6axgUbzuCMpQu7hpoP08CE9Vte8LOksQ80T+/GNz8NFVu2E04wtA6qUR+P5T4y4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713187898; c=relaxed/simple; bh=RTcp4ChnIgmlmEcfEQU6EJGn9gnNOY6imrmIY/RWxas=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bS/AH7fLb69kQ72C2TrKYAjC4idNKKgYcCCsdVDxF0i8hCLwLCEf2JY5b6InP0FR7SVDtHCvEChuNGtyZa0pDjff+guGiZKmQJmK/3HeW3YmSt3u4U23nTxn18k+OU/9gzVwhXar+eTBxTuKLYLKre/PTV1zEcpq7yaNVwZb08U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hZFeOpk6; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713187892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Odozy2BLDSJ3flfmqEEsFw+Lc+xUdGcL/TjOYgEXfpE=; b=hZFeOpk6NfU7lRxtbb4s6Du74vGjTaUXByloqj2JwtznCVYpIQhL8dC5ubh7iwuyAeN99r IquDs2h8/++sMgshQltbypkbrdt2UwWemud7WvM0xPDvEqzvRceQcFe1PBAZMjK8q6zQC/ 4TUulwT2axebIx3fMe+hE50B71mHUnU= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-o1aYcjk_MuGQ9AEmV87FQw-1; Mon, 15 Apr 2024 09:31:30 -0400 X-MC-Unique: o1aYcjk_MuGQ9AEmV87FQw-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6ea10c8093eso394011a34.1 for ; Mon, 15 Apr 2024 06:31:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713187887; x=1713792687; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Odozy2BLDSJ3flfmqEEsFw+Lc+xUdGcL/TjOYgEXfpE=; b=JpXgmqjxTh+42IjgxAHOumCZoclPu1BgRk4i0EZtEJ0i20G6daMkuGQyvac6MQXnsg wyvskBqR8j5ytodjpC52CsTyPrQjiI4hiZdLCCYhi4NE8w9omZV7o2Aoyq+ltmepBaZ6 ghLRbrL1xHZCwUMD8aug7ymL4JTp18hQfeuW0g82zupEHzGc0h7qxV34DeeJXbpcGQh5 u0uOoz4LsMjw0dojHFPzDisziKIj3/iFfU/JCYPrHHYpnSzD0vUE4GNENpmFnrGwmduU PursEvUub1jCJ7sjnKD7imzp6NSnScOfIUXOkLE9ByBdOs1FLgxBj0kz+Plsw9f4Lya6 YI6A== X-Forwarded-Encrypted: i=1; AJvYcCWNmiLQRxc0fOJz5rFBF+MQyiUibWYHuyHCF6DAmhWEgS+k3KBKkQfZZfeahqu707bduZR4gOkZmkw464pmgDTF7tHJC86XszX7YPch X-Gm-Message-State: AOJu0Yw4Oa751zd5TcA0oVilx2qdXbcDQL0EXlnd8RaIW/XTZRse3DhD WacDfnobzOwwi4WxWM22wTrEqzz1E7vD049/scq9Kkqfdq7v77otqTPKLwIx/6IGnvNmWHdmMCA 5Hfthd2ZYux2aIaR0BDHwUNdbJFsXWXA81F8BXO1CcYOhMkbusPUv2JMZ8Jadng== X-Received: by 2002:a05:6830:108e:b0:6eb:7e33:3fbb with SMTP id y14-20020a056830108e00b006eb7e333fbbmr3038922oto.0.1713187886774; Mon, 15 Apr 2024 06:31:26 -0700 (PDT) X-Received: by 2002:a05:6830:108e:b0:6eb:7e33:3fbb with SMTP id y14-20020a056830108e00b006eb7e333fbbmr3038894oto.0.1713187886392; Mon, 15 Apr 2024 06:31:26 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id v23-20020a05620a0a9700b0078ebb13a03csm6315948qkg.67.2024.04.15.06.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:31:26 -0700 (PDT) Date: Mon, 15 Apr 2024 09:31:24 -0400 From: Peter Xu To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, willy@infradead.org, david@redhat.com, lokeshgidra@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] userfaultfd: remove WRITE_ONCE when setting folio->index during UFFDIO_MOVE Message-ID: References: <20240415020821.1152951-1-surenb@google.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=utf-8 Content-Disposition: inline In-Reply-To: <20240415020821.1152951-1-surenb@google.com> On Sun, Apr 14, 2024 at 07:08:21PM -0700, Suren Baghdasaryan wrote: > When folio is moved with UFFDIO_MOVE it gets locked before the rmap and > index are modified. Due to the folio lock being already held, WRITE_ONCE() > is not needed when setting the folio index. Remove it. > > Reported-by: Matthew Wilcox > Signed-off-by: Suren Baghdasaryan > Cc: David Hildenbrand > Cc: Peter Xu > Cc: Lokesh Gidra Reviewed-by: Peter Xu -- Peter Xu