Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1408862imw; Tue, 5 Jul 2022 08:58:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vd/pjttsrVczJnGGQN0r1hGlf/KyOqdeZevXav9u0JQZYC9NdEeuBKEhPOvCFak9k7o+E6 X-Received: by 2002:a17:906:8a6c:b0:72a:e5f9:1b08 with SMTP id hy12-20020a1709068a6c00b0072ae5f91b08mr3439011ejc.505.1657036720804; Tue, 05 Jul 2022 08:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657036720; cv=none; d=google.com; s=arc-20160816; b=EAuWglIYae65zF2lde4016Dsxpj43oGGeQiFi1Ii6p5Nd0BTuerAv6xeKnMRCMOc/o ywAH6234xh6OysoZaLxRnpBl11AV4qUJ5BVyxq3sT2YmPMb1JRufXpBqr3MqRHf2d5Hk K9jUfiHIPrJj8Fb+pp+bn/D1AhfZj5vGHAtEfFBj8nJLivrf9o3aAPcq/WseqtM/uQlc 6DlcvOOjcJ4IkUidRZYLKK5tDWTjVB1qhRIvoRFNWCSS6mmASIXnp1EK4Yatm/yVqqLW ZYIsoBMDZIbV0+k4LlQF4dioF5ejOBe2FU/wM55WMcS5G5J1HQS64g9ljAHGIv2WD823 6NXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=+mOvx1LHO+r0HBiq3jN+NAgJzGM4J0XRgiHur4Meacw=; b=Wm6TG7qSj7NkYmjvVCxPwec6JUGKHmx8cu/CcDZPBHt94atnMlAfrWP3R1XMM8a2+Y XH0wq0E+6cMbv4vk2HAmFGFQj8UM/h1kY9jVEZYyoPZrvfS9UcGqTmtRTayywO8qGDsB 9WT5fOO/ew2o2EJWFS3fk5JZC1BsdgV64aY5Yz9fj+HJKU/qTxx0rbXEoOz2GP+Kp/bq MlLpazMJSbWCftaYHjFG88zHIAQsnjla1K2x1mlvKIVm3KKaXeJREQhzbKVvfGoFWj4/ 1rJDyzTblDSJj/P+mSWEwF1ehid2C1AyPSFj9abz0jgaSeepHv9pH1u2GkvW1hR18Uol 8xSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht8-20020a170907608800b00726c53b9203si18298352ejc.860.2022.07.05.08.58.15; Tue, 05 Jul 2022 08:58:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbiGEPTG (ORCPT + 99 others); Tue, 5 Jul 2022 11:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiGEPTF (ORCPT ); Tue, 5 Jul 2022 11:19:05 -0400 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DA239D for ; Tue, 5 Jul 2022 08:19:03 -0700 (PDT) Received: by mail-qt1-f182.google.com with SMTP id ay10so14089392qtb.1 for ; Tue, 05 Jul 2022 08:19:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+mOvx1LHO+r0HBiq3jN+NAgJzGM4J0XRgiHur4Meacw=; b=Co6D/94rkaLdYKQAAcSvKaa80Rjbx4cUiRaZ8364CIDfRz3UCNSWdu2dg9lfuiJ/kP +YIU7em6SgEWsq0nw+S7swSf4M2SbaIwZyt4ngKGk5izJYpbxjXlb5teKyikYHmEjBdd YiJxaO77YEgjM84iu9LW2u0a3l0z4ub6ovW5C9BYW+RGUagru47B0NPwERbZa+V+Zgv/ eLkmQT0yZ6OVj8jZnp2MziWeCGtLcFKZhOlPKO+L4XoEfKqBwE1PruhCDXExMmLmF1sM 703iYcXzy36no++1BvoZPjRdp5VJOJfC6NaGcnINNMeXq+El3ZqhND9KvuHUSxnogqYG g4QA== X-Gm-Message-State: AJIora9OeVwbAzBAKyX2AEtq9aVx2IJuKnd046sYNU99BfmcqQrSAIgO mUDuxJV+t/m8JZewR8+2PTkCBk+PzMP4pQ== X-Received: by 2002:a05:6214:62a:b0:472:eac1:7565 with SMTP id a10-20020a056214062a00b00472eac17565mr12663969qvx.71.1657034342625; Tue, 05 Jul 2022 08:19:02 -0700 (PDT) Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id q15-20020ac8450f000000b003177f0fb61esm21592877qtn.75.2022.07.05.08.19.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jul 2022 08:19:02 -0700 (PDT) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-31cac89d8d6so42620867b3.2 for ; Tue, 05 Jul 2022 08:19:02 -0700 (PDT) X-Received: by 2002:a0d:c787:0:b0:31b:a963:e1de with SMTP id j129-20020a0dc787000000b0031ba963e1demr40017641ywd.283.1657034342075; Tue, 05 Jul 2022 08:19:02 -0700 (PDT) MIME-Version: 1.0 References: <20220615021059.862643-1-imran.f.khan@oracle.com> <20220615021059.862643-3-imran.f.khan@oracle.com> <270b640d-d5e8-b775-9a16-5d5d07f959ff@samsung.com> <9e95f138-9ec5-90fc-7ea9-cf8cff8bf180@oracle.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 5 Jul 2022 17:18:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/4] kernfs: Change kernfs_notify_list to llist. To: Marek Szyprowski Cc: Imran Khan , Tejun Heo , Greg KH , Al Viro , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Hi Marek, On Fri, Jul 1, 2022 at 2:51 PM Marek Szyprowski wrote: > On 01.07.2022 14:20, Imran Khan wrote: > > On 1/7/22 9:22 pm, Marek Szyprowski wrote: > >> On 15.06.2022 04:10, Imran Khan wrote: > >>> At present kernfs_notify_list is implemented as a singly linked > >>> list of kernfs_node(s), where last element points to itself and > >>> value of ->attr.next tells if node is present on the list or not. > >>> Both addition and deletion to list happen under kernfs_notify_lock. > >>> > >>> Change kernfs_notify_list to llist so that addition to list can heppen > >>> locklessly. > >>> > >>> Suggested by: Al Viro > >>> Signed-off-by: Imran Khan > >>> Acked-by: Tejun Heo > >> This patch landed in linux next-20220630 as commit b8f35fa1188b > >> ("kernfs: Change kernfs_notify_list to llist."). Unfortunately, it > >> causes serious regression on my test systems. It can be easily noticed > >> in the logs by the following warning: > >> > >> ------------[ cut here ]------------ > >> WARNING: CPU: 1 PID: 34 at fs/kernfs/dir.c:531 kernfs_put.part.0+0x1a4/0x1d8 > >> kernfs_put: console/active: released with incorrect active_ref 0 > >> Modules linked in: > >> CPU: 1 PID: 34 Comm: kworker/1:4 Not tainted > >> 5.19.0-rc4-05465-g5732b42edfd1 #12317 > >> Hardware name: Samsung Exynos (Flattened Device Tree) > >> Workqueue: events kernfs_notify_workfn > >> unwind_backtrace from show_stack+0x10/0x14 > >> show_stack from dump_stack_lvl+0x40/0x4c > >> dump_stack_lvl from __warn+0xc8/0x13c > >> __warn from warn_slowpath_fmt+0x90/0xb4 > >> warn_slowpath_fmt from kernfs_put.part.0+0x1a4/0x1d8 > >> kernfs_put.part.0 from kernfs_notify_workfn+0x1a0/0x1d0 > >> kernfs_notify_workfn from process_one_work+0x1ec/0x4cc > >> process_one_work from worker_thread+0x58/0x54c > >> worker_thread from kthread+0xd0/0xec > >> kthread from ret_from_fork+0x14/0x2c > >> Exception stack(0xf099dfb0 to 0xf099dff8) > >> ... > >> ---[ end trace 0000000000000000 ]--- > >> > > Thanks for reporting this issue. It has been reported earlier in [1] as well. I > > am unable to reproduce it locally. Could you please test with following patch on > > top of linux next-20220630 and let me know if it helps: > > Yes, this fixes the issue. Feel free to add: > > Reported-by: Marek Szyprowski > > Tested-by: Marek Szyprowski > > Maybe it is related to the fact, that I have earlycon enabled on those > machines? Probably. I see the issue on - rbtx4927 (CONFIG_EARLY_PRINTK=y), - SiPEED MAiXBiT (chosen/bootargs = "earlycon console=ttySIF0", chosen/stdout-path = "serial0:115200n8") - Litex/VexRiscV (chosen/bootargs = "console=liteuart earlycon=sbi"). It doesn't happen on the boards that just provide chosen/stdout-path in DT. Reverting commit b8f35fa1188b8403 ("kernfs: Change kernfs_notify_list to llist.") fixes the issue. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds