Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp489274lqr; Wed, 5 Jun 2024 11:40:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZdnGwfKtq9I+WtwptvSUyU3oueEihiFjXZwsUoFXaetyOtglUrdpE/j+VV1ZOItrG1NHew98Blvs/8vzTX0YUp8oFE1FdFoh0JlcT0Q== X-Google-Smtp-Source: AGHT+IEL+JlIArxqnWsvBK+UqljwHRlJmN0EiWQ9XcLwIWFnRunIsi2jhpI6JCfuUgmRY2LeqDOt X-Received: by 2002:a17:906:1793:b0:a68:c745:d586 with SMTP id a640c23a62f3a-a699fcdf818mr231245366b.42.1717612815106; Wed, 05 Jun 2024 11:40:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717612815; cv=pass; d=google.com; s=arc-20160816; b=UHBLnhcnzWkrqCezC/dRz6TCwCe05/sxl5KWiGJl+UgWpW1RoBhRM3c3hUsx0qTNbV 3V7e4xilLPwGT4Pp9cf4l2F8P9CLQ7R7fk1BGtThC6Qij9+NNNacmjUG2SV9bU4JAEis AFItAKlfT6vH5OCXZJOETgJqS8mDV5mdDQXgNZJD0b0xcInFjLtGMqHESSqmqu7pvnsI k3964R6DyMNq7UTJKrtL0jTjTyqlnaYGpzZgkfVe7mM5vP/1friNUNE9tQdnWjE6TqUD Wq4orfsaTPsEGQL3XV8bnVkCThrneI3yAIYK9YOqvvVYGlBB0uiEoMWjcb4BFgjBKGjj /b6w== 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; bh=ONmmmcLiMl2I2NqZG4ex45tOZGcbYxwe1wj46M3tgjM=; fh=0zCIpKUUfXNR4vgEGKRVdryXrgfIVE1T7Yen7VUJyhA=; b=BG7+Yot6bf4iOUJIowhQRxXp7TYFGwujJu+bD9bwTMWLorLKKzug6VoBMpRPN61J1j +TJP9KeiXfdWNot5zil6b4DQjGuweh/3gDx5V0lJ4CVbVkH6c0yT3jLCh/6PItQE1a8B lLZXAD23XiUlse5OxmIQxsU75RUi0U4XA8t/ZitNQP7Bw6bXoixrCvOIu/QZe3uS70y2 zS/d9v25kiA60nA9wU8keAKdwqL3Le0Izg+ZZ2a/ISlMs15g52J/Fl1wugzeKFwnk93I KBMcY325Rsmp3XU7XHDk0JC9w0T0dWPCTF6/0ayIgOva2Oz5In4KxVgXEdwSqOsQuRWQ 1hzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-203068-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203068-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a67ea38dc14si653156466b.472.2024.06.05.11.40.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203068-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; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-203068-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203068-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu 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 C77C71F22DD9 for ; Wed, 5 Jun 2024 18:40:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF85113A898; Wed, 5 Jun 2024 18:40:08 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 543B95C96 for ; Wed, 5 Jun 2024 18:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717612808; cv=none; b=lcWVfQj8vBcAY6pTR8+jfciT1H6NsU4BSz+jX58r5khMTTRQ8ArHAXSkt6q7D3/mgJk+d7CqGpkh+u542Vv/4rX3ooI2NsOTpD31aty/wjyVQNISc0HvvbymveslG8NOdQFVj5brMx9YJaSGJCXOKa7qmpk/b74OD0Ia5ZtotT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717612808; c=relaxed/simple; bh=0jI3CUuP5puOjAYBI9zzxgoVgLBurSEEXQshgD7sXEk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UBZpb+VrXzlOlRliQ2uVZ96H6gMjp11lb0qSXgrbjWKcCuA0dNSPWb9pugg/ZlYXDORa4BmjLpLl/SNT+UsuVFkjjbISZiSsw+4cRH+m47zdV4B+uAnCPhIT1kb8QZFb+9DVFc3Awx2rmHY4kqr2h8efdeDWeLykcb5MYorxu5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 205382 invoked by uid 1000); 5 Jun 2024 14:40:05 -0400 Date: Wed, 5 Jun 2024 14:40:05 -0400 From: Alan Stern To: "Paul E. McKenney" Cc: Andrea Parri , will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, hernan.poncedeleon@huaweicloud.com, jonas.oberhauser@huaweicloud.com Subject: Re: New locking test for the paulmckrcu/litmus github archive Message-ID: <1d175b42-84b4-4a48-b1fb-ab6fd3566f75@rowland.harvard.edu> References: 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 Content-Disposition: inline In-Reply-To: On Wed, Jun 05, 2024 at 11:25:11AM -0700, Paul E. McKenney wrote: > Thank you both! > > I queued and pushed the following commit, please let me know if it > needs adjustment. > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit fb65813a7a181cd86c50bb03f9df1f6a398fa22b > Author: Alan Stern > Date: Wed Jun 5 11:20:47 2024 -0700 > > manual/locked: Add single-threaded spin_is_locked() test > > This new litmus test demonstrates a bug in the current LKMM lock.cat file. > This bug results in the following output: > > Test CoWWW+sil-lock-sil-unlock-sil Allowed > States 0 > No > Witnesses > Positive: 0 Negative: 0 > Condition exists (0:r0=0 /\ 0:r1=1 /\ 0:r2=0) > Observation CoWWW+sil-lock-sil-unlock-sil Never 0 0 > Time CoWWW+sil-lock-sil-unlock-sil 0.01 > Hash=cf12d53b4d1afec2e46bf9886af219c8 > > This is consistent with a deadlock. After the fix, there should be one > execution that matches the "exists" clause, hence an "Always" result. The part about being consistent with a deadlock is not very important; I'd omit it. Also, the second sentence is ambiguous; change it to: After the fix, there should be one execution that matches the "exists" clause and no executions that don't match, hence an "Always" result. > diff --git a/manual/locked/CoWWW+sil-lock-sil-unlock-sil.litmus b/manual/locked/CoWWW+sil-lock-sil-unlock-sil.litmus > new file mode 100644 > index 00000000..cee5abf4 > --- /dev/null > +++ b/manual/locked/CoWWW+sil-lock-sil-unlock-sil.litmus > @@ -0,0 +1,24 @@ > +C CoWWW+sil-lock-sil-unlock-sil.litmus Where does the "CoWWW" part of the name come from? If it refers to coherence order and three writes, I'll point out that the litmus test contains only two writes -- which would better be described as a lock and an unlock. (Or are you counting the "write" that sets the lock's initial value?) > + > +(* > + * Result: Always > + * > + * This tests the memory model's implementation of spin_is_locked(). > + *) > + > +{} > + > +P0(spinlock_t *x) > +{ > + int r0; Oops! Apparently I managed not to convert the spaces on that line to a tab. Can you take care of that? Alan > + int r1; > + int r2; > + > + r0 = spin_is_locked(x); > + spin_lock(x); > + r1 = spin_is_locked(x); > + spin_unlock(x); > + r2 = spin_is_locked(x); > +} > + > +exists (0:r0=0 /\ 0:r1=1 /\ 0:r2=0)