Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1506116rwb; Fri, 5 Aug 2022 03:15:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4G6KX6RI0d1SUj7N4q9hrffqm19S5m6T8ANJ0qE1ahNy2NhtFNVV7cbOVRA2yqmmpx6MJF X-Received: by 2002:a17:906:d54b:b0:72e:ece1:2956 with SMTP id cr11-20020a170906d54b00b0072eece12956mr4823400ejc.156.1659694549890; Fri, 05 Aug 2022 03:15:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659694549; cv=pass; d=google.com; s=arc-20160816; b=bdiI1FT1rJkc7Fl+hb17cZj09SHeYN8QO8TsvbW0OP2AHjvgaEP+5YpkGwdNSw5ssP P+/s6MKuYNoK6KzgWG5pFRD5rhmzsHmOSiXzuh/Yiw2jRMFxFWp/zAYn8lZ8eT3gAEFW 4pvXt2TOcm21MyJ+uuefcTx1m4tdW/6xMVo3MNvOfeLKJrvkzFyZrmcr9ID5J0pucbip uOBWitXDBWTOfZBCYc7OkrHlY+SGgZZxd1I2vr7IWQ4iCzhL19vG3RgJSUlVR77hYL3b ziTyHw2cvmJp+0HvtOcU1gqMsuENlYvlAOmhydWsYw8mO5D9eVkMjbSkfMlTHbyp7PvX vDGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=ljhgzI/UF42hWnfoA4KaadY/VnflCDZrqOXQeik+4k4=; b=OoSd930ew+yIhn0w6GPNo1BFW2CGy2Nz47NZkJPhumK0POeFAgONSZ0kphhGLYXQQm fD4RNBFBcP9tnNCE9ooZB5NByJiVv3N11HcsF8o0JAP6y3aiCKXy6zqj6TKx+FZxfbIM F2pB8nuywuo2/lG+uNgnT8H9qDTnoLy/st8IFa2pThLj75Ir9u9P8ChPful8FvAt/9lL lulRQHeKEhvQ95CNUbRVCjMhoHRus29EKOofsKrTvJQlZ9r9Ilxf1MwKZPfRzxj07knt GY1KbY3mPAVXZ9c9mA4DP6IiQrUE5onqm3iwlv5pe2yyw5A+DyqPw886slccwuR86Bwr w+NA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=a788DdDn; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a056402521600b0043c2e89d0acsi4380876edd.3.2022.08.05.03.15.17; Fri, 05 Aug 2022 03:15:49 -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=@siddh.me header.s=zmail header.b=a788DdDn; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240449AbiHEJgb (ORCPT + 99 others); Fri, 5 Aug 2022 05:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237747AbiHEJg2 (ORCPT ); Fri, 5 Aug 2022 05:36:28 -0400 Received: from sender-of-o53.zoho.in (sender-of-o53.zoho.in [103.117.158.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F5329C91 for ; Fri, 5 Aug 2022 02:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659692153; cv=none; d=zohomail.in; s=zohoarc; b=e8TEMtLGWdvaN+wQZyT3nid9x9H52KceesT4LF/aXprbqVFGvnkFamzRHbUxCXVInKR1sF/J8vHtvD2elNhclA7fU+oEExzjU3jMMUt0QFODZPwJaQelvzYEYbcAnLd66+1UY7keDq6f+JlvGXR9lL/01Xc8sRFOBK1VrdVrusw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1659692153; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ljhgzI/UF42hWnfoA4KaadY/VnflCDZrqOXQeik+4k4=; b=YW/6kywpozQh5mHOMfZ6bANCeGZGJBACRGt1QvRdZuDozgR/Q1Go6ps9xugIQ5V92tOB6C6TAYk26mKUJEjU2s5gUd4fjQp2WNlMr8msuU0VTuB0GUaqum5GBpIS5sOfTTYLx3Q30M7xxOMzmNnt5NIg4E4ru2sNDnemFlLFhDY= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1659692153; s=zmail; d=siddh.me; i=code@siddh.me; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=ljhgzI/UF42hWnfoA4KaadY/VnflCDZrqOXQeik+4k4=; b=a788DdDnnTYwwNEgkeNo6PlCJubYZK4nrWsaH3b/BshXQbsqkzKY6FzY9kqGT8jL UlDeS2Cfg7+KrDRF9NNtnqF1DsA3HPgfKA1B4Jg4DAkCqNtkUSFN4JYYnqUAf+k3GN3 Djcu6mrZQbsKU1UAR7ET6isvaWDDveebxRlsY44s= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1659692141228305.5750996748818; Fri, 5 Aug 2022 15:05:41 +0530 (IST) Date: Fri, 05 Aug 2022 15:05:41 +0530 From: Siddh Raman Pant To: "Eric Biggers" Cc: "christophe.jaillet" , "corbet" , "dhowells" , "edumazet" , "linux-kernel-mentees" , "linux-kernel" , "mchehab" , "rdunlap" Message-ID: <1826d5c4a90.282ac4bf118702.5300662644268737477@siddh.me> In-Reply-To: References: <20220804144152.468916-1-code@siddh.me> Subject: Re: [PATCH v2 3/3] kernel/watch_queue: Remove wqueue->defunct and use pipe for clear check MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_RED 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, 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. This was remarked by David Howells here: https://lore.kernel.org/lkml/3558070.1658933200@warthog.procyon.org.uk/ > This isn't the correct block comment format; it should look like: > > /* > * This pipe will get freed by the caller free_pipe_info(). > * Removing this reference also prevents new notifications. > */ > > - Eric > Okay, will make the change. Thanks, Siddh