Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1821472imw; Tue, 5 Jul 2022 16:23:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGS9tjiynAzNt9F0Yre9lMhQic6gi0r9kQSPAj8hQPvZd1uwk4ZYlZix+uEDY8nDzo6bqI X-Received: by 2002:a17:902:a589:b0:16b:c227:d7f9 with SMTP id az9-20020a170902a58900b0016bc227d7f9mr24088692plb.29.1657063426654; Tue, 05 Jul 2022 16:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657063426; cv=none; d=google.com; s=arc-20160816; b=hfGK8f/z5DBQ5vzRMnsB/BpK2BItIseXsqRPqEpZ/nSrT9MywfIWnhT0sPg1weRLRo IIJM/P67/aV4/HKmtlGQGgxHAiBkDz9DTau62PTk0daJwX0iiBZnT3EfCdUagJ4qY4W7 nQH3lDp1UAjZI2wxM7WQfY5jJdWjZLquC5u1x7JbtUghuuD+/5+qDu9Bj2FoEy+FbArb k4kxgH6Ete4WrwyOd/q5glOAmUROYgULTYFJ6tZZQ623wd7MoBppAC3FaByICQz+KGxB yKyUqOdYgLoR0qSaEo8DdCI4kEh11zLDTCWjuPOC1zl8LFr8ZXDGYkCY6HWzk4a1Wles P7tA== 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:sender:dkim-signature; bh=U7+I4uzJ/2VjMUoauKjA9TnrUXhcNYd0QtO4aLroN08=; b=Zumo030i0iBCMXNLS0tWswqmWmC+kts4yP6rTEZFJjNnXZK+VWXRI3D+ImlknWKhob PjHL8zBdCkRutNh2yRAJOTJL34Pbp5Y/0YOKfAsrRHtQERZ4coq/C/yYyeXJ9Qvql54Z LjH5ed5teeoitE6eAveCHEtschesDRKuIFZPWPgvYY2hpSkkwIEg7T/KpRdZHki/LNKi IBmaZhIaNFerWjaVPxoH+u3nOYC1uUsI/FrBc/HBZOaMmRlg0bRXaW1j4c1oxntzC9mO VK0asUTtVLktszRF8exdKNh8lJLboaH0hKywiG5+6yXSl6Wx2v8h93Cd+wmuNA7dQ91p wZqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CcybPj2K; 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 np4-20020a17090b4c4400b001ef8fcfd821si7937204pjb.123.2022.07.05.16.23.34; Tue, 05 Jul 2022 16:23:46 -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=@gmail.com header.s=20210112 header.b=CcybPj2K; 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 S232288AbiGEWeo (ORCPT + 99 others); Tue, 5 Jul 2022 18:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbiGEWem (ORCPT ); Tue, 5 Jul 2022 18:34:42 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B29D62D8; Tue, 5 Jul 2022 15:34:41 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id s206so12605915pgs.3; Tue, 05 Jul 2022 15:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=U7+I4uzJ/2VjMUoauKjA9TnrUXhcNYd0QtO4aLroN08=; b=CcybPj2KaNJpXK/5prwzlQtIBlHt3LJMjq0uKBCygnzyD5mQfRUnT+H+gMJfR4/E5/ xmyQNi9ICa7hpjjrMnNER3qvH3c/b0G4Q4FH3tvaTk2yDAaq5HNz7QzgxCPDJHh2fy+p YX/F2JGpcSeoCEG1g+LkITbjeOB7Tny1ninBAqviDIL8HMbgBDBCdNET5Mv0hc5LGwQb ToiBOICrDsUTzbwz8g7Ou79Rwndzxk0O1bxuQpS7cuO64oywXBXpP/D55aAU4VriPbAl PhOkQ0tV0xRbNtUYfJZWmSA+ZNI0XK59zdk3zpkQ1NSrT9NFR/ee06aMOyKkh728eL8Q 7LAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=U7+I4uzJ/2VjMUoauKjA9TnrUXhcNYd0QtO4aLroN08=; b=KQW4TJxQ8r/bG69IHVUJPZj9rkMsIWIIZEscwXxG3FnHIft5klJU5/OucxXiGQkwL4 G4s9ZW34d2/23p+M8TTjMefkZcdMRqHuFnF77AHegNkeA7FZE4aP+kd7F6X3IqAtat66 VScHNL9qLOKTT8MRJ5U1+WrwF+FYUdlUqFH5Q0aQEIx1Md+2FmLRg3/cz4Cr8RVmyd/a Jxi8XNIzfvrqXcPPr9cX75bg9XWlv8wi4iCcvfMfVPNQKQ5Em/djQR47AXnIc6MN91A2 wb3qT8EHfd9NafP0RbK+eQKxcBCZgCK0cr+bKNyfNvZPhVyMOK8jiottrGZnm7dkUgm/ hzxA== X-Gm-Message-State: AJIora+ApA8J8xB9T9yRUgpWWrTg6CvlYKTHzrSUa+XAQ26XQlj/DnlK 3MLLbkwd20Xor0hauEosfPo= X-Received: by 2002:a05:6a00:23ca:b0:525:28b4:9e3b with SMTP id g10-20020a056a0023ca00b0052528b49e3bmr42490538pfc.43.1657060480893; Tue, 05 Jul 2022 15:34:40 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:a568]) by smtp.gmail.com with ESMTPSA id 72-20020a62164b000000b0052893e26fc6sm2098176pfw.25.2022.07.05.15.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 15:34:40 -0700 (PDT) Sender: Tejun Heo Date: Tue, 5 Jul 2022 12:34:38 -1000 From: Tejun Heo To: Imran Khan Cc: gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk, m.szyprowski@samsung.com, nathan@kernel.org, michael@walle.cc, robh@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, guillaume.tucker@collabora.com, pmladek@suse.com Subject: Re: [RESEND PATCH] kernfs: Avoid re-adding kernfs_node into kernfs_notify_list. Message-ID: References: <20220701154604.2211008-1-imran.f.khan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, On Wed, Jul 06, 2022 at 06:18:28AM +1000, Imran Khan wrote: > In this case, the point of using llist would be to avoid taking the locks in > consumer. Given that the consumer can dispatch the whole list, I doubt that's worth the complication. > Hmm. My idea was that eventually we will never run into situation where multiple > producers will end up adding the same node because as soon as first producer > adds the node (the other potential adders are spinning on kernfs_notify_lock), > kn->attr.notif_next.next will get a non-NULL value and checking > (kn->attr.notify_next.next != NULL) will avoid the node getting re-added. So, here, I don't see how llist can be used without a surrounding lock and I don't see much point in using llist if we need to use a lock anyway. If this needs to be made scalable, we need a different strategy (e.g. per-cpu lock / pending list can be an option). I'm a bit swamped with other stuff and will likely be less engaged from now on. I'll try to review patches where possible. Thanks. -- tejun