From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E74B212178 for ; Fri, 25 Oct 2024 13:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729863892; cv=none; b=VzzIA0WtM3db72iTCL40ysF3mJr3rUPv8o6b4jXGc5proL7b+Hj6s/kI32+68T4giYC+TZvA40+6+ENJTXclZ1NlDT/GC3t9RA2p6rRSEfI1mvFzFo29HP+mu28Ryw1E6pBAzXZlI9beyOT/o4XeTIVPmR5Et9wQzTac1KHg+7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729863892; c=relaxed/simple; bh=CAGdnmzdmoxehVcocaTIzbUj70Qf3mpqjSw3BlHYZLE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XzRX/lqpqtATmPdLAYGCWRFbFCM9GqzdbpsjshVjD4SPNNrWne/GYe1aPoE7oRbYNk0vwgPqQdDuiZZ4PxoosSDBSq4DQs1TSlK5TYJzgG385V89R7KOMeBKLYRmnpPOay5XBlkZoi6U31TVmOtgU1s0Qwrx11u4ra4TQiCfqlU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gVALYTqy; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gVALYTqy" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2fb518014b9so16825281fa.3 for ; Fri, 25 Oct 2024 06:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729863888; x=1730468688; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4f0K/pz8OIuDj4u41V8cbDxkZ5f+rnJD0V2U71WHUqg=; b=gVALYTqyoOE63x/2wGRAXS/2Yn0PrJCiFHfyROjwhI4eeXdULyMhkfdfth++WfP393 dy4J6HXQnLF0P9bK8vvFtzYblcq6D/SkZ/VRM7ThTcHwL45cQGSoRHP8skCOf9Fbide6 BVEguS1qBGdJtMancnk+YA2qH1MHT4ysKN31B8Lm36JvoXinx3VVUpaoudRzi9hRj+lN KyqWIK9j4dEGuP5KAKQO4YsQAeJ2EXMxkffprUnRL7PmJIxWjGGyMk46utdsp4JnNnSD rmDaPBnbVeEO1ce+DAHibrQ5dD8pV80Whf65PZRQznWM38cTyMXPLAhKsI0vg8xdFGqY +SgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729863888; x=1730468688; 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=4f0K/pz8OIuDj4u41V8cbDxkZ5f+rnJD0V2U71WHUqg=; b=uWqg2LQ9ZRk+91QIgEanl2nb2Jogrm+4rHcIy8W9zt1hd2RYFRLwCZ9rCJMtcTVwrn dCeQHOqFXJjetzv7VTUA5XtuMaKgy3zA065HLx8tWUpfZaruoD07+BotLm181fX4RsWg b4fvOyxZ4MG9G8BRRR6Og59cZBrp3QnifBA7rrzrPWmkyVxq42kPO5tVvLsgqvjJ6WbW 62iEPF2ZRhNnCQzimAdAQ14v1nF3r/8YPd/ZaxJI/B1rBg0jmgjzuqkYIQSwT5pjRxxT nvJf18nwGjNj5+8plWjWdUwwMOxMiPMik4GLxmNdb7cHXlIGjkeSwU4OrtBulrEfJPOk PDlQ== X-Forwarded-Encrypted: i=1; AJvYcCU7+BPQlNNZknC4PvYU64jOSx1Bz0ABHS0E7mIZQSJveA0FMdx+C/nM+QDitOW0EVXwx6Gu@lists.linux.dev X-Gm-Message-State: AOJu0YwxitwbckOYf16E+E4HVHJj3cr+0OclDoB3BzCo6/HNbcHbnuxC g4D2XPzHgArqdrTyOlBMhuaHTB4ZGc8yPKJ7uAh0sol/B4/tLpi4M4tT9k9kxV4= X-Google-Smtp-Source: AGHT+IGoqZxgt4vnEFXeIWFdTuQwrFVFALq98fDR3NB0uwiegeoRX/yP0fQXW4Mkw5d0K3PQFPgCTA== X-Received: by 2002:a2e:4e12:0:b0:2fb:70a0:91e7 with SMTP id 38308e7fff4ca-2fca81d7213mr25486181fa.10.1729863887846; Fri, 25 Oct 2024 06:44:47 -0700 (PDT) Received: from andrea ([2a01:5a8:300:22d3:a281:3d89:19cb:ed96]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cbb629f338sm638903a12.35.2024.10.25.06.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 06:44:47 -0700 (PDT) Date: Fri, 25 Oct 2024 16:44:44 +0300 From: Andrea Parri To: Hernan Ponce de Leon Cc: puranjay@kernel.org, paulmck@kernel.org, bpf@vger.kernel.org, lkmm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: Some observations (results) on BPF acquire and release Message-ID: References: Precedence: bulk X-Mailing-List: lkmm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Oct 25, 2024 at 03:28:17PM +0200, Hernan Ponce de Leon wrote: > On 10/25/2024 3:15 PM, Andrea Parri wrote: > > > > BPF R+release+fence > > > > { > > > > 0:r2=x; 0:r4=y; > > > > 1:r2=y; 1:r4=x; 1:r6=l; > > > > } > > > > P0 | P1 ; > > > > r1 = 1 | r1 = 2 ; > > > > *(u32 *)(r2 + 0) = r1 | *(u32 *)(r2 + 0) = r1 ; > > > > r3 = 1 | r5 = atomic_fetch_add((u32 *)(r6 + 0), r5) ; > > > > store_release((u32 *)(r4 + 0), r3) | r3 = *(u32 *)(r4 + 0) ; > > > > exists ([y]=2 /\ 1:r3=0) > > > > > > > > This "exists" condition is not satisfiable according to the BPF model; > > > > however, if we adopt the "natural"/intended(?) PowerPC implementations > > > > of the synchronization primitives above (aka, with store_release() --> > > > > LWSYNC and atomic_fetch_add() --> SYNC ; [...] ), then we see that the > > > > condition in question becomes (architecturally) satisfiable on PowerPC > > > > (although I'm not aware of actual observations on PowerPC hardware). > > > > > > Are the resulting PPC tests available somewhere? > > > > My data go back to the LKMM paper, cf. e.g. the R+pooncerelease+fencembonceonce > > entry at https://diy.inria.fr/linux/hard.html#unseen . > > > > Andrea > > I guess I understood you wrong. I thought you had manually "compiled" those > to PPC litmus format (i.e., doing exactly what the JIT compiler would do). I > can obviously write them manually myself, but I find this painful and error > prone (I am particularly bad at this task), so I wanted to avoid this if > someone else had already done it. FWIW, a comprehensive collection of PPC litmus tests could be found at https://www.cl.cam.ac.uk/~pes20/ppc-supplemental/ppc002.html (just follow the link on the test pattern/variants to see the sources); be aware the results of those tables date back to the PPC paper though. Alternatively, remind that PPC is well supported by the herdtools7 diy7 generator; I see no reason for having to (re)write such tests manually. Andrea