From nobody Tue Jul 15 17:24:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bhQzb1VXSz62ctr; Tue, 15 Jul 2025 17:24:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bhQzZ4dgpz3RFF; Tue, 15 Jul 2025 17:24:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4ab71ac933eso17340461cf.2; Tue, 15 Jul 2025 10:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752600280; x=1753205080; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=o9bZGFJAVY/et5DW9cS/t5hz9Nl+J5OzyJ1AbpaVmGE=; b=Fbdv/5nWrPJvZirXxncRoYEmv2GghkfNuewp4M38q37BG9BOvuK8Np2WdptVLU/nUk DfvUMCOtMgFWAlT4WFKrOZOHRk05xb1e0nzCqV79eLh/NuL4p44mCFCmh2fMESP4KF2P o1HzJDIGi3KIx3KxLpax/KKFyug7StP0itCH8/s+f0/DxHWiYt8wzZgvKisGUbYkyrSV n4HTfcksc19n6p6bll47loNxJguFZRkeA1TuEzasMxm49wcZiX9yiY08QdIPlqn/ycWq Nl/NHqZLPwb2QIAeZ/2knBYCBgisnJtR6XXErB3Dn6h2rjnyEZJAZkYWjgDnZCzxxzoA 86bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752600280; x=1753205080; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o9bZGFJAVY/et5DW9cS/t5hz9Nl+J5OzyJ1AbpaVmGE=; b=M+jDXkBT8iYA6c9bl/4ZNE7myHfj5g060ZIozoEaJWQeqkdorZbIbHQob37Nh+upRI eBUXpNFqGwBMvmXtZrKX6jXJRhHgrd3h6SacSFo2LzmCMWBy3ckDUdT9xcEO+nHcj8j6 QcKNQjG/G6LUIuIPJdsH5V4BboMLa465kkW73xysEkeSIDpo/Kc9ax9VAjVQEobsD09M c4hr3k7wGtY/mGH48pBrJGNEXBJDBQ44A/e6DyJLFnMcbn0OSR+B8TtScsAo1apZBhLg cehVgrZKRJj8fAY082/LmYED/7U1MLasH+xMWzVZSgEwvkKKeAb2eI9XBo5In2AtwNzo aHgQ== X-Forwarded-Encrypted: i=1; AJvYcCUyMYxJQLGaGI5L6G0RvyvHp5DRdh6r6buHNYVZc7Fn17+gJAQ06fi9RI4h9NGeBk7GFMiZ7FaT+Pa1RQ6Dsn8=@freebsd.org, AJvYcCV7aFeRFFK2EBLK5vwuITZJTxlgBcEcj5V6aOiRxjrYwxfAexNeT3QLnrBk+tv6VzyiprN+Xo1oMFSFv4Wa4BZCiNNv@freebsd.org, AJvYcCVcLpWTdJu83nOzV9OugpHEwQfrW6jUBYZvGS/keoZTObVgAQYnDlqRuwUEPiAO0sfvUYJE@freebsd.org, AJvYcCXf6uNyYmDndlObR8ik8M1/HWmmyPPulf4fxv0FPcOhyCpBDKzJMzXo6y2Cw0q6OCpMAfvCwMhXq3pew1EPpOoLP+xkaRE=@freebsd.org X-Gm-Message-State: AOJu0YyMRtxfc1WiaTFBO8hnNDC2D3fmZEhy2QWpyurrFP2TL2fSf93N NjJEgDaccuwuW5Pbdrxbupvd0pyZsreJbwikq542TIyS8AB+e1dBMsNz90xllEIA8Tc= X-Gm-Gg: ASbGncuLymdvkEHJt4Ex9d7SgM9hx9mW8JnpXWW5mtmnNCEID+zMTRCgg4BpQjQSW5L j4nvptZLkj4jgc8x7eYugZDn99186CCztSuq5cP8rrS+TkDHjSaxlNxGt79ztMiGE9jVbr5gFG2 Bkc32/aFbeC+r4CYvpq4YtGpkFoZ53wQN8+BOUPAmHEgsskCq7Eqz2xA5FIVKDZv2K3T37+fN2/ WXkpARhTU/phGJWYiePkufY4d59d1oyNN+4rGt107WcY5EQqnIeVtirhzJ0RJt2eWxtWHubfbWB NIsjtPsj8aYe33elAkRJ/ampW+6abhTkCWaLzHVJ+rH9jlWj2rdc53RAW9Xy2l3ZW1+g0Sg7fNk kNk4KpnE5lpnUFoIWORiiktHDCJCo+yGtnzMLppsZ5Ql9wOY= X-Google-Smtp-Source: AGHT+IEuqWQnvJOKNvZ/kYU6KwFB3FJL57qlwZcXb246TC4EKyqp62H3OgD0UCiQ9Ri9RvspwdFriA== X-Received: by 2002:ac8:7e82:0:b0:4a9:a3ff:2830 with SMTP id d75a77b69052e-4ab90ccabb8mr4212001cf.42.1752600280294; Tue, 15 Jul 2025 10:24:40 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ab6de94c3esm22041021cf.36.2025.07.15.10.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jul 2025 10:24:39 -0700 (PDT) Date: Tue, 15 Jul 2025 13:24:36 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: alc@freebsd.org, kib@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fad79db40505 - main - vm_pageout: Remove a volatile qualifier from some vm_domain members Message-ID: References: <202507151519.56FFJ4FS013944@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bhQzZ4dgpz3RFF X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 15, 2025 at 09:40:18AM -0700, Gleb Smirnoff wrote: > On Tue, Jul 15, 2025 at 03:19:04PM +0000, Mark Johnston wrote: > M> The branch main has been updated by markj: > M> > M> URL: https://cgit.FreeBSD.org/src/commit/?id=fad79db405052f3faad7184ea2c8bfe9f92a700d > M> > M> commit fad79db405052f3faad7184ea2c8bfe9f92a700d > M> Author: Mark Johnston > M> AuthorDate: 2025-07-15 15:16:40 +0000 > M> Commit: Mark Johnston > M> CommitDate: 2025-07-15 15:16:40 +0000 > M> > M> vm_pageout: Remove a volatile qualifier from some vm_domain members > M> > M> These are always accessed using atomic(9) intrinsics, so do not need the > M> qualifier. No functional change intended. > M> > M> Reviewed by: alc, kib > M> MFC after: 2 weeks > M> Sponsored by: Modirum MDPay > M> Sponsored by: Klara, Inc. > M> Differential Revision: https://reviews.freebsd.org/D51322 > > What's the benefit of removing the qualifiers? They act as documentation > and they match atomic(9) prototypes. To me this looks like removing a > const qualifier with a reasoning that we use the variable only as an > argument to functions that have const qualifier. Note that I updated the comments as well to indicate that accesses to the fields should be done through atomic(9), so the documentation is preserved. The reason atomic(9) prototypes include the volatile qualifier is to permit their use with volatile-qualified variables without a cast, not because the interface expects only volatile-qualified parameters. More generally, I believe that new code should always avoid using volatile to provide any kind of synchronization, ignoring the case of accesses to memory mapped with non-default attributes. atomic(9) intrinsics should be used where they are needed, and some comments should explain the synchronization protocol if it's not obvious.