From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1370CC25B07 for ; Fri, 5 Aug 2022 18:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241321AbiHESd2 (ORCPT ); Fri, 5 Aug 2022 14:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiHESdZ (ORCPT ); Fri, 5 Aug 2022 14:33:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F2D7AC18 for ; Fri, 5 Aug 2022 11:33:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id 99EBFB829EC for ; Fri, 5 Aug 2022 18:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBAA3C433C1; Fri, 5 Aug 2022 18:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659724402; bh=3f5o70JbYlPCgy6ykT0F1POnBTLd6YMhY5LFfRMH/fw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QkS9cUj74TflOnU0+bxxreIvQS+BNlIOidVDR/w+/s4epHg8niNzflgQ9Rf6KrYaq SwCVQBgZ/r8jlkjw+Oc+oyPCWJsCshWhicmsbI+xiFciiWhY6qID9nYgut46YOZLiv rOGJtbLMFbh+jTjlI9SpCxxrU9PLPPwB9WskudvKm4bf09hDYNruZ3PDG13q7/UYtu fyzp0/SEscqaSjKVaVoqda1t+cpTk9D88/wuL6kCcvmobCywaMdcA3ooZZalupDd0H nSs0FYjnLboOlqig2VSyzdqrZUnSxHEzEh3uXnapUKIe7mHAOnyhX6/i83eAi3EuXB 0U3k/O+rvOcbg== Date: Fri, 5 Aug 2022 18:33:20 +0000 From: Eric Biggers To: Siddh Raman Pant Cc: "christophe.jaillet" , corbet , dhowells , edumazet , linux-kernel-mentees , linux-kernel , mchehab , rdunlap Subject: Re: [PATCH v2 3/3] kernel/watch_queue: Remove wqueue->defunct and use pipe for clear check Message-ID: References: <20220804144152.468916-1-code@siddh.me> <1826d5c4a90.282ac4bf118702.5300662644268737477@siddh.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1826d5c4a90.282ac4bf118702.5300662644268737477@siddh.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 05, 2022 at 03:05:41PM +0530, Siddh Raman Pant wrote: > On Fri, 05 Aug 2022 12:54:31 +0530 Eric Biggers wrote: > > Why is the READ_ONCE() needed? Doesn't wqueue->lock protect wqueue->pipe? > > We are changing the pointer while a notification can be potentially waiting to > be posted to the pipe. So a barrier is needed to prevent compiler magic from > reloading the value. > wqueue->pipe is only read or written while wqueue->lock is held, so that is not an issue at all. - Eric