Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2305028rdb; Mon, 5 Feb 2024 02:17:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1w6j16vSVQHBJWeGHhrUAFpVvsPHE77iTGy6+EDqApm+6UuGAdd3VGIURXuF9s8uy+E9B X-Received: by 2002:a05:6870:c08e:b0:218:dfd5:a5a6 with SMTP id c14-20020a056870c08e00b00218dfd5a5a6mr8612290oad.2.1707128252058; Mon, 05 Feb 2024 02:17:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707128252; cv=pass; d=google.com; s=arc-20160816; b=lfcvLe2TLXLR/FVHHZSxaUHQ6M4m8Vmx50+txAnOOi6W8WX0/OwrA4xd3yDll/H3NR 49LU9IYbRJLBtSQf+SuQduLQOMlFqJJcQLqwr7iLZO8f4pSHU/3bjT+7O7BcGNPqjZxl IH9oZEUxV0OJ399BcnNjQBgqMlkjhgN/5K8DWDvXK+YeKOeP0ZGERt0NX1+sPejFjTd8 GzeKHg8BdO2Lf0a4kRGX0Ze2S4dYdRkJ7IUxHlM0Jo5qkk3m0wOnjWC74nRUodPFSqJM MS7f96eafNs0u/oT4rDESa1HxWVVT9CZ1Cvtqdq8+gfkoVx9sFjzIPRASFwr1b+ddrHk OouA== 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:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=xeAME5NJejmJ4/yncKQREcQWWC8NXPkaZdoWiVbdd10=; fh=30UugdWd7a27ojHgafO9xWk5TuVHMN3w42kyGS2qQ24=; b=tCh/hozIlfper5wLHrWEdhv4yU/XeeKiyeiI0fmyFMyX0bDIwY360zL+tYjN6GzJMv MFkGPbBj9mpY1k8Dk4FjsR3D/K6C2YsTnQa+iyUu1KKTyn8Jc6Ufy9nk4ClAYF+8bhqs Atm/8lR9K8zjiiDHKT43gmzpPYwuIuxjxt5IDh1QgtcyklQpNFc/BNetzmGsOOkWSdnF 26kUd2iHP2jvjWaMEA33jgzCcSQW1cnd9AApw82vDNf6F18NEsikX+4P0ZudtSDFpuBc qQ6ozvX+Yn1FLqO48r/XwG9iLP3/M1mG+MtXcb/Jy7xBmyRSmOyh+4TDdEqsPvz1qy7u hiOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=0NmPUl2l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=0NmPUl2l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=a2wU2Jsi; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-52384-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52384-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWe22/QVQUQzul3OVE53OwBotxnmFGPXKzkeoDphtbIqvuURGK4w+hsGBtNoq8eX3c2V4Ld8zTDwDSdPcPKAuqk/j5fmZsUa0nHo4SWGA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w12-20020a65410c000000b005dbec9faad0si5981671pgp.408.2024.02.05.02.17.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:17:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52384-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=@suse.cz header.s=susede2_rsa header.b=0NmPUl2l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=0NmPUl2l; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=a2wU2Jsi; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-52384-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52384-linux.lists.archive=gmail.com@vger.kernel.org" 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 61C3E283F8A for ; Mon, 5 Feb 2024 10:09:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11835171A6; Mon, 5 Feb 2024 10:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="0NmPUl2l"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="a2wU2Jsi"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="0NmPUl2l"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="a2wU2Jsi" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 474581429E; Mon, 5 Feb 2024 10:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127772; cv=none; b=BM6ivH4hE51g/m7xvAslLlckAtYMJQoOR+SE1oITURpMzs8u7eE/iI4sBdJspkY4UmmPb4d7CmpeMweyrEg+eoQ8HxtO0kWxQbgyN4l4QMQKizWRcfhJd/uSPw7lxdwDfV4K2IPycNbJeF9fTacOhkxSsr+QUQ2ssyLm8WEVh9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127772; c=relaxed/simple; bh=4lJmjeGnsuESibq4dkXn4aEwYKCDtRtnV3ik8Ze43YY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IW8zLK/dEqXUJc/lg1mf/qOxSnFkPR/4uqlDhT3V+jg27qOrgVtI/41dDNg6bKA6GJWF5DwX+X6k15ma4LpMN/Lia8mnde3d7yhGkj32o4IGFXnoDrIuB6f0dOfF+uQ1MRk9yuOMYlcWe9SwYQ6poFHUI0prkZ/BPO3epYL8b8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=0NmPUl2l; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=a2wU2Jsi; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=0NmPUl2l; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=a2wU2Jsi; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 68A761F8AE; Mon, 5 Feb 2024 10:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707127768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xeAME5NJejmJ4/yncKQREcQWWC8NXPkaZdoWiVbdd10=; b=0NmPUl2lfDqYVyYzOjo1vTt3dIIQb2/H6htvcRok60CBOdaultS7Li0P3XJ3uT77aKafoa YMG9+kq7m5jcwUWI+bZMaqMq40YBJB7V5dXvUgbAHiXUnuf1+XIy6RRS2TE7XT/poxoW2s lJadgenBfXH1vXms6QedkM+JMtPRpiU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707127768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xeAME5NJejmJ4/yncKQREcQWWC8NXPkaZdoWiVbdd10=; b=a2wU2JsihZ7r0qS4ifZseKKcW3AB5l/OQWpxMAGukvELCRrEc+PcSNPdKQJs925fbWkhs9 VswdBMoSOVOii6Dg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707127768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xeAME5NJejmJ4/yncKQREcQWWC8NXPkaZdoWiVbdd10=; b=0NmPUl2lfDqYVyYzOjo1vTt3dIIQb2/H6htvcRok60CBOdaultS7Li0P3XJ3uT77aKafoa YMG9+kq7m5jcwUWI+bZMaqMq40YBJB7V5dXvUgbAHiXUnuf1+XIy6RRS2TE7XT/poxoW2s lJadgenBfXH1vXms6QedkM+JMtPRpiU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707127768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xeAME5NJejmJ4/yncKQREcQWWC8NXPkaZdoWiVbdd10=; b=a2wU2JsihZ7r0qS4ifZseKKcW3AB5l/OQWpxMAGukvELCRrEc+PcSNPdKQJs925fbWkhs9 VswdBMoSOVOii6Dg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5E79E136F5; Mon, 5 Feb 2024 10:09:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id bl8LF9izwGXGKQAAD6G6ig (envelope-from ); Mon, 05 Feb 2024 10:09:28 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 0E5A6A0809; Mon, 5 Feb 2024 11:09:24 +0100 (CET) Date: Mon, 5 Feb 2024 11:09:23 +0100 From: Jan Kara To: Kent Overstreet Cc: Jan Kara , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, peterz@infradead.org, boqun.feng@gmail.com, Alexander Viro , Christian Brauner Subject: Re: [PATCH 1/4] fs/pipe: Convert to lockdep_cmp_fn Message-ID: <20240205100923.3vb3p247c5q2a5qe@quack3> References: <20240127020833.487907-1-kent.overstreet@linux.dev> <20240127020833.487907-2-kent.overstreet@linux.dev> <20240202120357.tfjdri5rfd2onajl@quack3> <3nakly5rpn4eomhlxlzutvrisasm6yzqaccrfpnpw2lenxzfmy@vpft5f4osnye> 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: <3nakly5rpn4eomhlxlzutvrisasm6yzqaccrfpnpw2lenxzfmy@vpft5f4osnye> Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -2.30 X-Spamd-Result: default: False [-2.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-3.00)[100.00%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[9]; DBL_BLOCKED_OPENRESOLVER(0.00)[linux.dev:email,suse.cz:email,linux.org.uk:email,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[suse.cz,vger.kernel.org,infradead.org,gmail.com,zeniv.linux.org.uk,kernel.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Flag: NO On Fri 02-02-24 07:47:50, Kent Overstreet wrote: > On Fri, Feb 02, 2024 at 01:03:57PM +0100, Jan Kara wrote: > > On Fri 26-01-24 21:08:28, Kent Overstreet wrote: > > > *_lock_nested() is fundamentally broken; lockdep needs to check lock > > > ordering, but we cannot device a total ordering on an unbounded number > > > of elements with only a few subclasses. > > > > > > the replacement is to define lock ordering with a proper comparison > > > function. > > > > > > fs/pipe.c was already doing everything correctly otherwise, nothing > > > much changes here. > > > > > > Cc: Alexander Viro > > > Cc: Christian Brauner > > > Cc: Jan Kara > > > Signed-off-by: Kent Overstreet > > > > I had to digest for a while what this new lockdep lock ordering feature is > > about. I have one pending question - what is the motivation of this > > conversion of pipe code? AFAIU we don't have any problems with lockdep > > annotations on pipe->mutex because there are always only two subclasses? > > It's one of the easier conversions to do, and ideally /all/ users of > subclasses would go away. > > Start with the easier ones, figure out those patterns, then the > harder... I see, thanks for explanation. So in the pipes case I actually like that the patch makes the locking less obfuscated with lockdep details (to which I'm mostly used to but still ;)). So feel free to add: Reviewed-by: Jan Kara for this patch. I'm not 100% convinced it will be always possible to replace subclasses with the new ordering mechanism but I guess time will show. Honza -- Jan Kara SUSE Labs, CR