Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2015898rwb; Fri, 5 Aug 2022 11:37:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7nBhieqvLvF+3qHZqhLuTw534wiub0teGLWDr8ugpG/DoFeV4cZknojhz/SVmsQ0XW2cJG X-Received: by 2002:a05:6a02:185:b0:41c:30f7:1fea with SMTP id bj5-20020a056a02018500b0041c30f71feamr6580774pgb.487.1659724623975; Fri, 05 Aug 2022 11:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659724623; cv=none; d=google.com; s=arc-20160816; b=URPpI8czvlTAR7U6BGUV+LfwnmCi/KgRN/YZJQI8mNKAbIWe12S8skWXtvIUIovJaA MDi02h6uBBFfJ3O3J7rm24sKRMjG2Lun5mcg7Y06rYNDLj3iHHEvaXSnW13TSt78hfN+ X2QGVUmsJs25LsJ3KrT3WDssYmXCEy9pF8I/1hL8qrOb9uGtHxlAgpgWUiE6RJO40E9A dalCPBp7IaC7jLV8uMR7k3om5HXercReaD33tR8pWb8tftEWtUWqiATRHpK2YpDmrMp2 EUXGbaJIfTrYRjx87vFDQERLBUlKJaSatatJCb/HA/BN7s113KQTO6BYSco9/agjtpaQ ZdLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+XlO7lbnM29xISGZ7YHOloMQ3itYRgpVG/Jw8KnUF0Y=; b=afPGFtY7qFj5q0CLs3GaTUdO8UWAWe9U+bMZvBYmzaua/MN3urYVc6w036LSLtMNay OGFhh7kAnbdtTw3WYxnKTN8owtfL9gA2024bLY+Ko8gc1hNGYofQRNBKHjDmDj2bAuP4 BmgJkrST6CpNszTV0VxFvCiN52L0dKH1lfrTs3aGlsvw5LcDr9kOcknT7H4fXrnl7flT fYF7vBrHkFOz/6IAagr4abcOZ6kjWflf3hvb85t5E0D7VQFjdsI7v4yErLs6REFGUXDA pBBLaP41tyCdexQwMBnI79FqbeNN/eD6u2uhAxkYZJkC/H6yUYosub7h+2a7TaSFcA74 UOVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QkS9cUj7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a630a0a000000b0041bc0b2c95bsi3630174pgk.359.2022.08.05.11.36.49; Fri, 05 Aug 2022 11:37:03 -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=@kernel.org header.s=k20201202 header.b=QkS9cUj7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241265AbiHESd1 (ORCPT + 99 others); Fri, 5 Aug 2022 14:33:27 -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> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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