From nobody Wed Feb 15 22:05:11 2023 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 4PHBw40hgsz3rPbW; Wed, 15 Feb 2023 22:05:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHBw35h0Zz3h1g; Wed, 15 Feb 2023 22:05:23 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vs1-f52.google.com with SMTP id g8so21477045vso.3; Wed, 15 Feb 2023 14:05:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=sh/3W2j3Vi3xwdCuH6FBvuLI2LBw4t/ud6xTLE4HBAE=; b=G6EJVT4YaUTNX9gqZTggyknq91BhXTqoCiqA0DUs7gOuAFyBiDJg4k70Nl4OMQkThI U3SbvCi2bS96oLAAX3XlZFa0iXvLSsAnGe2rq/3GJvCqKBu1UlirC2J6Y0/ykC/RMr5k MSMjQ2FerdKhOV6/JFwnOHRA2L3MkDBsbHnMek5KoHRgDED7HNNsFLhCsoxJtMv30FVj WwMRKr5+P3nye8iTTtqD5TLfUWoPIigqbqRbQdMiAna2k3q0t8Xe8d67AmZXDjR3r0RE 0YLG7YA5YkEgMK9d5ivfTjSZ/q+O9pRVvenEoKOsM/k78YoZcCIwwIj/nhAPqUWR0gmj 2UNw== X-Gm-Message-State: AO0yUKVQAetqZGDQHVtuyiFV69hmdKZgz9xlrXeFgpLzfd0MDSqsrFjN JvSKGYIcpuNJVthRYocDpdIkCBfQuBnL0IXKFU1APBH9 X-Google-Smtp-Source: AK7set/TE2g/d9xiTWhudo3ZChi0/FXh1yvOn1h46sUkndx2iaeCRGXUI8FtF9gUAk//GufEztOKoEnP96x+RbGq44k= X-Received: by 2002:a05:6102:20c1:b0:3f7:93c4:9e56 with SMTP id i1-20020a05610220c100b003f793c49e56mr733110vsr.85.1676498722539; Wed, 15 Feb 2023 14:05:22 -0800 (PST) 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302152133.31FLXEep021521@gitrepo.freebsd.org> In-Reply-To: <202302152133.31FLXEep021521@gitrepo.freebsd.org> From: Alan Somers Date: Wed, 15 Feb 2023 15:05:11 -0700 Message-ID: Subject: Re: git: 98844e99d40a - main - aio: Fix more synchronization issues in aio_biowakeup. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PHBw35h0Zz3h1g X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 15, 2023 at 2:33 PM John Baldwin wrote: > > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=98844e99d40a90ae89d84762e07150af3a8f89bd > > commit 98844e99d40a90ae89d84762e07150af3a8f89bd > Author: John Baldwin > AuthorDate: 2023-02-15 21:32:52 +0000 > Commit: John Baldwin > CommitDate: 2023-02-15 21:32:52 +0000 > > aio: Fix more synchronization issues in aio_biowakeup. > > - Use atomic_store to set job->error. atomic_set does an or > operation, not assignment. > > - Use refcount_* to manage job->nbio. > > This ensures proper memory barriers are present so that the last bio > won't see a possibly stale value of job->error. > > - Don't re-read job->error after reading it via atomic_load. > > Reported by: markj (1) > Reviewed by: mjg, markj > Differential Revision: https://reviews.freebsd.org/D38611 Thanks for fixing these subtle problems in aio_(read|write)v. Will you MFC too?