Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1533573rwd; Wed, 31 May 2023 15:38:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+3n3TAy6cPxNlcJUtfb5+li3jr+imTW92s/XHl86DbUE+PQzI8qxMQUNtb85vihQdYIzo X-Received: by 2002:a17:902:7045:b0:1af:cf34:a645 with SMTP id h5-20020a170902704500b001afcf34a645mr5025773plt.21.1685572713116; Wed, 31 May 2023 15:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685572713; cv=none; d=google.com; s=arc-20160816; b=sQmqkBbNU8S/LH/t/VTD3syf0K/WAVGhY3iAYpMtTXOKyc1Wdb+XsppqNHQ9Jeepkn p+HheOEErE6T4Xxoa3rcYn80al38byIawvthVLMT66Cn2SS3kyRVaZdKiLMqHiBugNyh le87cC19MMcM8ZWeRbRfNx5Fs/OtXH6YAkg8ARdIJB0llhElR+jDN3UV5hVxfH0H1P6S Z395q7h12GBzAbu+qxhwDUFCJ3sQn4PciZ5fOVxKDpnxQrenxU4FuiwJd/oZVFWvmjXn eIP525eSjAs5ecAggOUKIw+L5PPj6noXNvU4DgP9twxGzxcoHe5BZ9YcGXVLpVeSHf+t OgNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=xRFHdstbTbdMTDgM1djX5TDO/8Zax/YrHRNV4h7RKRk=; b=HQP+HbVc0JAc72hMDCibUsDG70WkcXNz/RZyFEZhjM9gmN6j9CJ/c7Kbz7zaufNZfD IzJ7VGq1kbbuhdRxi7OCS+CQDojaSp2PUFq9HWneUSpSiGmbc8/JytpprFMmtKeLLV+O qsQ7WERjXYqKYZdqhhIkxIGxRQAHDibDR6b2q53nE2NEqtckqrkC/gK28s23GZYTHeB3 lVEHk79HFkxciTN5HZzkIwI89IhiY5hggX6+xpVQIZnoEFTyzkRoEJW9SPtTWYtzcMOf pYSb8Gir6zEVDm2GJpH5CoG8YHvbHQogwcHeJ14ofuxj+KfQnAo4uyXjcTng+iJ1IGJG TUuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=TZMfM5rs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a170902ce8200b001a6d4eab493si1811234plg.26.2023.05.31.15.38.20; Wed, 31 May 2023 15:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=TZMfM5rs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbjEaW0l (ORCPT + 99 others); Wed, 31 May 2023 18:26:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbjEaW0j (ORCPT ); Wed, 31 May 2023 18:26:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B1E121; Wed, 31 May 2023 15:26:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89027638CF; Wed, 31 May 2023 22:26:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7C3FC433EF; Wed, 31 May 2023 22:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1685571996; bh=GLdTZT4HM6RZRsPHV8a0vMFjHc8lEpx8uCyJo3MeHgU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TZMfM5rswADqWCsRolufOd8giHly7EDvFZjm1j2z6+ao1px7qYu7rmis+fh7q7wGx rgHvIqscK/GbFqLhz4wF4JJ7Ti8LQijh8/3GQ27JAo6Vg53xEFp4FaPH6GtmKGcBb1 PP3FRUr1LW7tUfBJ7nySU1daueFlDWgKO3TZH7MY= Date: Wed, 31 May 2023 15:26:35 -0700 From: Andrew Morton To: Benjamin Segall Cc: Christian Brauner , Eric Biggers , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH RESEND] epoll: ep_autoremove_wake_function should use list_del_init_careful Message-Id: <20230531152635.e8bb796bee235977c141138c@linux-foundation.org> In-Reply-To: References: <20230531015748.GB1648@quark.localdomain> <20230531-zupacken-laute-22564cd952f7@brauner> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 May 2023 15:15:41 -0700 Benjamin Segall wrote: > >> Can you please provide a more detailed explanation about why > >> list_del_init_careful() is needed here? > > > > Yeah, this needs more explanation... Next time someone looks at this > > code and there's a *_careful() added they'll want to know why. > > So the general reason is the same as with autoremove_wake_function, it > pairs with the list_entry_careful in ep_poll (which is epoll's modified > copy of finish_wait). > > I think the original actual _problem_ was a -stable issue that was fixed > instead by doing additional backports, so this may just avoid potential > extra loops and avoid potential compiler shenanigans from the data race. The point is that the foo_careful() callsites should be commented, please.