From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F48CC433DF for ; Sat, 25 Jul 2020 03:52:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6533E2070C for ; Sat, 25 Jul 2020 03:52:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="t9nPHl5K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbgGYDwK (ORCPT ); Fri, 24 Jul 2020 23:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbgGYDwJ (ORCPT ); Fri, 24 Jul 2020 23:52:09 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E832C0619D3 for ; Fri, 24 Jul 2020 20:52:09 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id k4so5577427pld.12 for ; Fri, 24 Jul 2020 20:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=bQivI2KWuf6QsCtu4WYpm/cqse3jOtGZ9zv6Uhe9MH0=; b=t9nPHl5KUilDZALXtGbibjXnq/hhM1EQ5Aa1D9KwICK/sKS8DUic55FPYMjgJ5a/dy sQLr7DmRdwWOsAYliDkDgimprF/m1QoM8yaIAdiBZzmlSZo+fcfKA/Nnrx5hlU2uojes BWvLGFvNIPAejc3zzaBDwH7RQwZLwDeTaV7eSRpI5sOkSLuoAWTeVbQxShNWBT1Dl92U ufDi73WqvHWN0kJLIlGcJM1NvNFiIfOIezxJBdmSI6EM4MVA8teSzM2aeuTtcWUeF4ef FeLSFyPRnlQo/9aSl8j3lE7wu6adSsn4a+LmxLBtPSp4PPkQGJzZYC4zGVy7l3esWV16 FQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=bQivI2KWuf6QsCtu4WYpm/cqse3jOtGZ9zv6Uhe9MH0=; b=dLmmn2SbW7rjRrZkJSl//mRSuQ3W39cJC2b5+a0pmCOLcWDWZtjsyPEUYD28RtNFZX OAVF/pIR23DAhDhwxoD/24Vo0rCspn7CqgtXHe2tRss4UpR/4V54pUzhGgoxgq/XA/uZ 8yrFhp1Wa0/uzXO0gm2b4luZ5fp3xL5Nm78o1HJQL1GshyNw/COrCoXsvuquwtghpULM UlvynGS5MlwKyqFLoc0LdYiReF/SMakmhVDQkYiJFy9YAedq2XEwzR/K4NDQNRfWPs/y h7dmM14nW9zVS3MEYRu/RhE3fWqaZZQ1tseSW04RwNi/VjkQcOnzFbpxb2sEuv2yZNkO OfYw== X-Gm-Message-State: AOAM531NHtMfMT4F5JWwQwpZYr+5KA3mN8SUqqXrTOEZu7n6+xymU0ln UY+P1DROMvIQpSPJCfGQ2AM= X-Google-Smtp-Source: ABdhPJz/XGEUgAcXD0EwSmf5StMhgG5deDUBK+8Ks8TR6Y2NfXAhYaLSy/XY2EwH4ABUVv0a9vKtvw== X-Received: by 2002:a17:90a:1387:: with SMTP id i7mr8772992pja.3.1595649129095; Fri, 24 Jul 2020 20:52:09 -0700 (PDT) Received: from sol (106-69-185-93.dyn.iinet.net.au. [106.69.185.93]) by smtp.gmail.com with ESMTPSA id y11sm8467570pfp.73.2020.07.24.20.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 20:52:08 -0700 (PDT) Date: Sat, 25 Jul 2020 11:52:03 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: Linus Walleij , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Andy Shevchenko , Maxim Kochetkov Subject: Re: gpiolib gpio_chrdev_release duration is about 30 ms Message-ID: <20200725035203.GA8572@sol> References: <7eb11c0d-cd11-f873-c336-4ec955a7bdb3@inbox.ru> <190bca20-946f-52f9-64f8-8971da17d38b@inbox.ru> <20200718042548.GA43247@sol> <7a22761d-c930-3597-6bf1-c799f70a47f8@inbox.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Fri, Jul 24, 2020 at 09:36:03PM +0200, Bartosz Golaszewski wrote: > On Mon, Jul 20, 2020 at 10:14 AM Maxim Kochetkov wrote: > > > > It works fine with this patch. Thank you so much! > > > > 18.07.2020 07:25, Kent Gibson пишет: > > > On Fri, Jul 17, 2020 at 06:07:04PM +0300, Andy Shevchenko wrote: > > >> On Fri, Jul 17, 2020 at 5:17 PM Maxim Kochetkov wrote: > > >>> > > >>> I need a small userspace program to do some GPIO magic to communicate > > >>> other hardware like devmem. This program takes about 2,5 seconds just to > > >>> find GPIO lines by name. > > >>> > > >>> replacing synchronize_rcu to synchronize_rcu_expedited in > > >>> atomic_notifier_chain_unregister gives the same boost as removing > > >>> synchronize_rcu > > >> > > >> Have you tried to replace an atomic notifier call with a regular one? > > >> IIRC it's still not clear why atomic is used there. > > >> > > > > > > Indeed, I recently submitted a patch to switch the > > > atomic_notifier_call_chain to blocking_notifier_call_chain, as some of > > > the chained calls can sleep. > > > Not sure if that is related, or if the change would make this case better > > > or worse, but it would be interesting to find out. > > > The patch is in the current gpio/devel, btw. > > > > > > Cheers, > > > Kent. > > > > > Linus, > > I think we should consider submitting this patch for stable then > because this slow-down was affects previously existing use-cases. > That patch is post the cdev split, so it certainly wont apply to an older kernel. I'm happy to backport it if you need it - just nominate the branch you want it for. Cheers, Kent.