Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp57360lqp; Tue, 11 Jun 2024 14:38:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcZjIdfZZDVbibmJUTB+5Uez1TcKM/p0JtBSq5Ythw6A2qefQwxMW1V6OQVOt3PifNAXCoWoJ38J91PMWDzl7HJgdn425Racjazjni5w== X-Google-Smtp-Source: AGHT+IE7jEn/Y6sdUCdJRGbq2sIa56+O0r4+GS3BlRDP5aeeEr4ImnMQiXjtwWjeoO4wa9ipleFz X-Received: by 2002:a05:6a20:3d89:b0:1b6:7d90:1c96 with SMTP id adf61e73a8af0-1b8a9b589c6mr234191637.22.1718141936407; Tue, 11 Jun 2024 14:38:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718141936; cv=pass; d=google.com; s=arc-20160816; b=cnJugwRnsX95/cz8mo8RLzFuxnQyKpYOGrMbBeOmuYwHgKkgWUEnvLx4Q1Kff4078G LFMqGNuqAXEll0ncHDBhJy9fm94iLYbSm1E9S/6sRIhWqu51FLHE78+yhF2iLYe9F7OO 2fjva/nPJjBYsVMpTR87SwF5Ncz8AOY5m7twYk625EE2QBTcjrXd/1fMKJ9IJjbBsOEQ 2JzWYxziv9VBSqoDZv6ZdIPIT1hUawmCVWhsb7Jz4cnIRoIdIVE+C2QLqctuVpB08/77 2Fn1o9Rxr3ZPmvEfpdTXZPsJOoS1EHPVKNLJK5setKp+xZl7YD7Dhqeax1xUiCO4yfa7 damA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SpKLP3/PYYk2S5W110YgI1G09xFxTWkXzi4V4Rve3Bg=; fh=7Bo8pBysMFy/0uY2yZRxPOrX/3M2nxKYJwh3MT+9uvc=; b=E6ceCCITH6zf0Evj9dW/htO/LplnU2XKbMgK/OLPNGG5rfWxGsNE/Z6NuxXxebe8BX nwZ5Y2xlyvpXELkwoo9hO/D8mwe79iPBWlqd2Mtx1IjXKyq5eqXz325NyaIKpznmHu3q v6KcLbEmo11LKXA3pRkowTtR2ngeQRJcH3BcaxC/8yiQm9tltsFE3MXc2r/c/OJtdGyo hDR/5rv9GeWkfbzuIKVNlScdIiQqf9B4wkk8aAQk2MgCf+Z+bnNEvyNayvalFpQL2oaF 4AvAokhhkkmwZR9yPiZWLNAL85I9t8xDCu7ZiATdQmv0hhhIh8+QJYFCACTeceOmpjDa TduQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ppe/Mzfv"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210620-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6ea804f44afsi5416110a12.582.2024.06.11.14.38.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 14:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210620-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ppe/Mzfv"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210620-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1C6F6285B54 for ; Tue, 11 Jun 2024 21:38:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CC07150991; Tue, 11 Jun 2024 21:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ppe/Mzfv" Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (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 9EDCA2033E for ; Tue, 11 Jun 2024 21:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718141888; cv=none; b=f/fWs58GTM0xkGfbTY54A3++R1SMoyEHfmw8YeLOljSZzA7LmawWgoTff2288nwgysdw2UflU82CGZRLFNkvMjzjoH0l+v6Ot3pByQ+2uH5Gxqeo6A/JoWfwWHqUqP/2XqY5J85qdUDx0EPc9AUKZ0D/4/V/e840FBPVK+9m/MY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718141888; c=relaxed/simple; bh=ySqUTx0evazFjjELB84p1DsaP5eR3ADWvtGXHiLCUdM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hxr5TcQAY4EJfOu2KP+fzEg8Yzz26OzigTIM1dwsD1ybx0Tu6yYr/1pl1z63tauFhzA28BM4RAITUK9YeJ5iZYaiaIYWeaz4QwzjIJ4bqKbxEAn9GvWpqicQeVSlTsQz2WFzYfF0seotcdy0J0Dz8yZtpdSSyhMgn1iuY53BXI4= 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=Ppe/Mzfv; arc=none smtp.client-ip=209.85.161.50 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 Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5b9a5be6668so715839eaf.1 for ; Tue, 11 Jun 2024 14:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718141885; x=1718746685; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=SpKLP3/PYYk2S5W110YgI1G09xFxTWkXzi4V4Rve3Bg=; b=Ppe/MzfvI7EL7WIa/qDMvSU6ouHVhrJTG2hk/2uxNbyVF6lm0T3/Ex0GoMFMMoN+hw jNXRC52H6HiNIfWVKLasHJ+/gcL7ojr59sEpx0RnKD4fXHJm7qVjKsKV4U9JZjj+8waq /kU5DjwBDkhB4OCVGTTicLV/gDmHpcEisCAFbLbS7QgVg79ZuO5JiQgsUL5g2TqbLbCI ybdcsLgxrRTDv/R1aOy+CuhlhFrIITsv2XY1GNcwnomwyNy/62QoAapdJB7wZU4n9lnp GlL3kxb/ZT11tBtZYJtEhLjL/YSzg+zfrL5WNrPal3RlcSqfTlyujQAioYbjBe+lxymb 4Qug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718141885; x=1718746685; h=in-reply-to:content-transfer-encoding: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=SpKLP3/PYYk2S5W110YgI1G09xFxTWkXzi4V4Rve3Bg=; b=l5fSwTr2R04GSJrWXlZqei4Ml1YfEo5XhKvYJrSwhOoJ9I6LjPxdKi9gDxIK2oOOzM CE2fI+tod/ZfocYzT3fBGszKe+043Vc5pd8g4PlXKt+EkSeRROPRxix++ad9OiVAGPcd KQF5vaeKBhjU3q7/cW6vJruoV81CpgZgrq26AqzBV1yU2vj8+StDMBFCemfLh/rUH0Cy iFeAzf0O4E0VsN+YuVuL/+LodjzUIiFMtW3xWbSkRAWGMsgDlTrTpvAjUlVXfD3rZ4pu tgKY+QIfuKcHrIrvcvAHW5VJ672UhEB0EB/QDmpZgxH6zHvDQWkGXCwNsKThzAMu5nfB gPbQ== X-Forwarded-Encrypted: i=1; AJvYcCUQX2PgUVdgRTvGk9pnREaFzTCjBzNLS0zpzM3S0xVTV2wMFybK0c06ZDYNKWhzxWOgvLcmbrGEcHfN2ORGcyKMTuuV8i3kYNFOvbQ8 X-Gm-Message-State: AOJu0YzWzmTtg/OgsQuza5tb1QbVy0CaGA1vEWV94TcSWHRyTxSfsImZ 2uNWpPEMa+IdJgo10dBzC4xm1jYLWNN7UIzwnszwx2Q6cQduvql+ X-Received: by 2002:a05:6358:914a:b0:19f:3a23:87a with SMTP id e5c5f4694b2df-19f69d9c14amr20293355d.20.1718141885077; Tue, 11 Jun 2024 14:38:05 -0700 (PDT) Received: from localhost ([216.228.127.131]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6de200843afsm8051313a12.10.2024.06.11.14.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 14:38:04 -0700 (PDT) Date: Tue, 11 Jun 2024 14:38:02 -0700 From: Yury Norov To: Linus Walleij , linux-kernel@vger.kernel.org Cc: Jani Nikula , Andy Shevchenko , "Rafael J. Wysocki" , Greg Kroah-Hartman , Guenter Roeck , Randy Dunlap , Andi Shyti , Lee Jones , Arseniy Krasnov , Johannes Berg , Bjorn Helgaas , Robert Richter , Vinod Koul , Hans de Goede , Nikita Kravets , Jiri Slaby , Heikki Krogerus , Kent Overstreet , Eric Biggers , Kees Cook , Ingo Molnar , "Steven Rostedt (Google)" , Daniel Bristot de Oliveira , Andrew Morton , Hugh Dickins , John Johansen , Eric Snowberg , Takashi Iwai , Takashi Sakamoto , Mark Brown , Kuninori Morimoto , Nicholas Piggin , Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , David Howells , "David S. Miller" , "Rafael J. Wysocki" , Len Brown , Sergey Shtylyov , Damien Le Moal , Niklas Cassel , Stephen Boyd , Florian Fainelli , Ray Jui , Peter De Schrijver , Prashant Gaikwad , Thierry Reding , Jonathan Hunter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Karol Herbst , Lyude Paul , Danilo Krummrich , Jean Delvare , Alexander Shishkin , Pavel Machek , Jernej Skrabec , Ulf Hansson , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Miri Korenblit , Kalle Valo , Kishon Vijay Abraham I , Sebastian Reichel , Daniel Lezcano , Tejun Heo , Johannes Weiner , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Masami Hiramatsu , Mathieu Desnoyers , Jason Baron , Paul Moore , James Morris , "Serge E. Hallyn" , Dmitry Kasatkin , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai , Linus Torvalds Subject: Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string() Message-ID: References: <20240603211538.289765-1-andriy.shevchenko@linux.intel.com> <87tti9cfry.fsf@intel.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 Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jun 10, 2024 at 10:08:00AM +0200, Linus Walleij wrote: > On Tue, Jun 4, 2024 at 9:46 AM Jani Nikula wrote: > > [Maybe slightly off-topic, ranty] > > > Why do we think it's a good idea to increase and normalize the use of > > double-underscore function names across the kernel, like > > __match_string() in this case? It should mean "reserved for the > > implementation, not to be called directly". > > > > If it's to be used directly, it should be named accordingly, right? > > It's a huge mess. "__" prefix is just so ambiguous I think it just > shouldn't be used or prolifierated, and it usually breaks Rusty Russells > API rules times over. > > Consider __set_bit() from , used all over the place, > in contrast with set_bit() for example, what does "__" represent in > this context that makes __set_bit() different from set_bit()? > > It means "non-atomic"... > > How does a random contributor know this? > > Yeah, you guess it. By the token of "everybody knows that". > (Grep, google, repeat for the number of contributors to the kernel.) > > I was considering to send a script to Torvalds to just change all > this to set_bit_nonatomic() (etc) but was hesitating because that > makes the name unambiguous but long. I think I stayed off it > because changing stuff like that all over the place creates churn > and churn is bad. Hi Linus, I think about renaming set_bit() stuff for atomicity at least twice a year. But it would be over 15000 renames for set and clear_bit only: yury:linux$ git grep -w -E "set_bit|clear_bit"|wc -l 12972 yury:linux$ git grep -w -E "__set_bit|__clear_bit"|wc -l 2914 Anyways, if someone is brave enough to do that... The main problem is that set_bit() is heavily abused because people don't bother putting the '__' thing, which leads to using atomic helpers where non-atomic versions are enough. So the right path for renaming would be: s/set_bit/atomic_set_bit s/__set_bit/nonatomic_set_bit /* Wait for a full release cycle or two to let people get used, then */ #define set_bit nonatomic_set_bit Thanks, Yury PS. Had to drop all maillists except for LKML and some random victims because my gmail account doesn't allow more that 100 recipients. If you guys know how to increase the limit, please advise.