Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2539176rwb; Sat, 6 Aug 2022 00:47:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR747NiDYYaVPEiQPQD5TRk+j2c8+YihC69679lGzR/yb4GxwRvwEOgPECk0HW6fLCTOd/AN X-Received: by 2002:a17:90b:3702:b0:1f3:366c:8c77 with SMTP id mg2-20020a17090b370200b001f3366c8c77mr20179390pjb.119.1659772023141; Sat, 06 Aug 2022 00:47:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659772023; cv=pass; d=google.com; s=arc-20160816; b=0Pik6hCeujlb9G7mzrG4Qfk2U4OszRYc8M7gfyHzDsiiQm0dTHcNrbpdQzHOAQjoYS z2lQ6Gs5T1QXfnHBkZwvMgX4h0HQL+aexBFRLlm5ce9Asvg+AQyG9mdgBZf7Qu6JYkbs 9O+CEXnY5GxeKvpogg16nFkbeoLEyNuTECLPh5mVT9uoT93+ygxRL9TtwYEA2aaSrODF NirgLyAllZM5+3lgfuaObpBsSRmjF2yGprTuO0uyU0w5usBx84lvigPxA5HOn0Q2Gjmw WWsSB2Q6hhwt3pcIi3AT9F7OeyG3pwyHazVbW9YBAAVSlSrFYL1BQIWqTp+QthMflDLf jp+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:message-id:cc:to:from:dkim-signature; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=mFz0DaPl0ER48fbpvu/86d1BqN0IGIzTqSSISKUQpyPsN5/tmhQdc/NfxvV3Yx2C5A YrvNV6AFmgmmouPXOVGV0P/BcT6n0FAhEcTHLEJIFY98Kudmk/DqSkQO9GOXR8F/ex5Z Qz9O2tnPgtQ2gDjZwc0zhCIyxaiEl0RE+pamPgC+Tvk0Bximngf80Gon1cd/qJ6LcLfH 5fcnQxoXM00bBo0IuKRtfSm97pEubCad+9GDV1dxRXPhzEuUaA7wL/MVKSqDDPh0QqPl R82BowvgbXT5yvXhjq5j0XL6gR0S7cZDWRJ4eOCyf1JFZ6q0m9UpUlVV0P+5Byn6s67X VGtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=mHsfL+o8; 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 oc12-20020a17090b1c0c00b001f31da6b2d2si7245842pjb.154.2022.08.06.00.46.48; Sat, 06 Aug 2022 00:47: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=@siddh.me header.s=zmail header.b=mHsfL+o8; 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 S241500AbiHFHos (ORCPT + 99 others); Sat, 6 Aug 2022 03:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbiHFHor (ORCPT ); Sat, 6 Aug 2022 03:44:47 -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 A2A0E11C35 for ; Sat, 6 Aug 2022 00:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659771850; cv=none; d=zohomail.in; s=zohoarc; b=b3K12+SyVErYDwLKEcAAHzlzpWFRanYDGTEPfYDxLCfK93RZLWSUxEUbJHoGiCQ+KIz0F/lFD7ThjB/Dwpx7ZTQGI5l0ImxN9UhMl8NgGL77iElL+TLB75kpTO02raICKgCiLAhg//QjWabE4G0VAzOkRxMw79DmrnnQZ/BoDEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1659771850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=Bkl7cYgUfX4YpxKlh1KAtZwQPkFBzJXwcghxL5yO+Sp4yJPANM66zKE7lHXwO9QvcRHuGYNbRzkS//DtZtk2o5qSTwbx0GojbB3epfCVyUBuERL0LTrqYDi0FJxXbe2NLGEQg+DmM8BL/j6xL8xE028wJw+OB13vOh5lF5qtQJM= 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=1659771850; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=mHsfL+o8SGKPIbTca18TuLmfTU56I7rcPPdbriwIMoNtp0iAg+P2DGg0kqcxRxLD VzbuE2fxUXC+SxNd+OPHe9cREukH0lQyQ6w7AgSWx3xTkCrMkM/yzZ0gIz75r0lVMtP bAmz68oSSokFuv+ZPzHavvwvTEaaBYdxUZlsX/3g= Received: from localhost.localdomain (43.250.158.93 [43.250.158.93]) by mx.zoho.in with SMTPS id 1659771849686186.95964539009788; Sat, 6 Aug 2022 13:14:09 +0530 (IST) From: Siddh Raman Pant To: Eric Biggers , Jonathan Corbet , David Howells , Randy Dunlap , Mauro Carvalho Chehab , Christophe JAILLET , Eric Dumazet Cc: linux-kernel , linux-kernel-mentees Message-ID: Subject: [PATCH v2 0/2] watch_queue: Clean up some code Date: Sat, 6 Aug 2022 13:13:40 +0530 X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 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 There is a dangling reference to pipe in a watch_queue after clearing it. Thus, NULL that pointer while clearing. This change renders wqueue->defunct superfluous, as the latter is only used to check if watch_queue is cleared. With this change, the pipe is NULLed while clearing, so we can just check if the pipe is NULL. Extending comment for watch_queue->pipe in the definition of watch_queue made the comment conventionally too long (it was already past 80 chars), so I have changed the struct annotations to be kerneldoc-styled, so that I can extend the comment mentioning that the pipe is NULL when watch_queue is cleared. In the process, I have also hopefully improved documentation by documenting things which weren't documented before. Changes in v2: - Merged the NULLing and removing defunct patches. - Removed READ_ONCE barrier in lock_wqueue(). - Improved and fixed errors in struct docs. - Better commit messages. Siddh Raman Pant (2): include/linux/watch_queue: Improve documentation kernel/watch_queue: NULL the dangling *pipe, and use it for clear check include/linux/watch_queue.h | 100 ++++++++++++++++++++++++++---------- kernel/watch_queue.c | 12 ++--- 2 files changed, 79 insertions(+), 33 deletions(-) --=20 2.35.1