Received: by 10.223.185.111 with SMTP id b44csp477736wrg; Fri, 9 Mar 2018 08:05:19 -0800 (PST) X-Google-Smtp-Source: AG47ELsO8LrS9wgxJ59D5f3rmAmpFgWRIubL6Wv0TEZUJVhNH2mH7wm9MBKSas86yVAKKbIfxGSP X-Received: by 2002:a17:902:900b:: with SMTP id a11-v6mr19262414plp.366.1520611519064; Fri, 09 Mar 2018 08:05:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520611519; cv=none; d=google.com; s=arc-20160816; b=EUPGfrP2OC0Az2/XQlaC62pVR53GOLBRvrXDS31c8XnJFEjOwgNj8zmKZHdHJrrvq1 S91tP/zVqZjZZrH91nkZAa+v7KoPzoGLu5VmyOLnsa6B7gC0kZAoh4O4O9NowM/cmYIZ FsD2MfbwNI0IgncvRo/ZM2Tr8LVRrY+kRjurrK92eTwkKAaG91KVYAtKqkYopV2f3x8D M7GV//W1KUbkmvp5yQ4/6iQWdSLMoJhzzo41doA2vyB3MRdrEFgtgjkg8vZNlWc7Dxps tExS3RfhstQ3ksSEl9q1fYyzIOkXcZKiE3Xt8HlT2lv8fnjuuRuI/LWgYaBKT28jhiNq qZng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=FGE1quvFsefQ5GTTs7AZTC/1rZCv9QUwOg4nYjLMTBw=; b=lhI+QeFwkNZCuCQsr5AkhgSFZwIaMYAKB6lWbd/qgCznVWstgBL5OXYjQW/jtP6Q2i M3HwJ/v6jw/PZ+Q4RO9TYGpVJ+GT7GprQ141Th8rMAPxHxGTlrS8XEudDmORFDY4pYzF EpyZFaIpXRFpvRokmeQ4VqVViHhDCi5pp2Ver8KsupeO2A4nIrcdTcnUpW7YuBnxkA6W Sxyeob/SKCiu2a8hoB69FsOqeLGRxyA2BSXQXvyesZeh0piWRcHEs2L706PzLr8HHpcV kqfNULf34DRaHYAPke63OX5ZVE2H5+eShSawXlvf9YzvDFhS0dGQppXFOWApfppg0jA5 6EWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mvista-com.20150623.gappssmtp.com header.s=20150623 header.b=o45cbWxr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21-v6si1091232pls.469.2018.03.09.08.05.04; Fri, 09 Mar 2018 08:05:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mvista-com.20150623.gappssmtp.com header.s=20150623 header.b=o45cbWxr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932183AbeCIQDc (ORCPT + 99 others); Fri, 9 Mar 2018 11:03:32 -0500 Received: from mail-oi0-f65.google.com ([209.85.218.65]:39806 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbeCIQD2 (ORCPT ); Fri, 9 Mar 2018 11:03:28 -0500 Received: by mail-oi0-f65.google.com with SMTP id t185so7318573oif.6 for ; Fri, 09 Mar 2018 08:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=FGE1quvFsefQ5GTTs7AZTC/1rZCv9QUwOg4nYjLMTBw=; b=o45cbWxrQm7HGZabQuMdLaIQq4tW7+x1I8OjBAICXPs8tgaZPKxMQdW7veb+JMdZuh 6l+9/cuKYY1nlTtSUtDTcioLHj8Td708ho/Yzc2OSNDitko+tO29leW5a4L6kQGpmZK3 QUu6Pr4bOw/E5t7gOebez0adFX9crgpa8kcqWtTQ8Is8POtmz0hAYnweJFkit+O0cr7q B1Y0AD1wJRQPyEmZHozXhgZFZ4OFpj0l424AVVhqWxPQnPzdhn5/B+GpVgpgnvW7yIJa qh1FoF42ht4kAVLEmdblmgZqXqVHDLmFQnpddxrXogj749mtKTo9WaHkVeYDAJasPTBe cE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=FGE1quvFsefQ5GTTs7AZTC/1rZCv9QUwOg4nYjLMTBw=; b=rU2Sj6Y7xqEbhJ9CFZ2vyQatSVHq5kyV3+azbvRQtBD+fx9ibKP2H15xCMh10qzxtE 0p3reF5CRLSORyzdSSu1V4yQ7x1HFRfdbRgDGbuT385Su+DHtvNgYU+LPWT9ZZOhzaqQ XitK4CRZdHAt7PWPONwk0NrkVdjvKNtW2jFL2OJoZ20nR/qUxBtMmV2l1g7CSyzKFpa5 PTtd7cpW17uSNdZpStfi74APc3f14HAzKrAyc18QWO2Z24zL2YDX3iV7WM2lURzQx9A9 ZZfdqrHGsBrQ4CNBbdHC1nEQAf+SrRUKAVoqmGv3npydaUrgHXWSJTNsMnWPvFaZTxfu RqXA== X-Gm-Message-State: APf1xPDSzyK7tPfY6nwSLBYLpoMzmLXtlqWgX0a0sIwCLs0gi6+/r8gT aQ0xUzZtLjAKMkL36erxuP+XeQ== X-Received: by 10.202.239.10 with SMTP id n10mr20624470oih.25.1520611403834; Fri, 09 Mar 2018 08:03:23 -0800 (PST) Received: from [192.168.27.3] ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id p200sm561416oic.0.2018.03.09.08.03.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 08:03:23 -0800 (PST) Subject: Re: Warning from swake_up_all in 4.14.15-rt13 non-RT To: Sebastian Andrzej Siewior Cc: Peter Zijlstra , Thomas Gleixner , Steven Rostedt , linux-rt-users , linux-kernel , Tejun Heo References: <20180306174604.nta5rcvfvrfdfftz@linutronix.de> <1704d817-8fb9-ce8f-1aa1-fe6e8b0c3919@mvista.com> <20180308174103.mduy5qq2ttlcvig3@linutronix.de> <20180309110418.lwtennjqwqcxh422@linutronix.de> <08aa9f8a-afe5-e1d3-5301-d196beb665b5@mvista.com> <20180309145819.af2546nfa4z6qqxm@linutronix.de> From: Corey Minyard Message-ID: Date: Fri, 9 Mar 2018 10:03:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180309145819.af2546nfa4z6qqxm@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 08:58 AM, Sebastian Andrzej Siewior wrote: > On 2018-03-09 07:29:31 [-0600], Corey Minyard wrote: >> From what I can tell, wake_up_q() is unbounded, and you have undone what >> the previous code had tried to accomplish.  In the scenario I'm talking >> about, >> interrupts are still disabled here.  That's why I was asking about where to >> put >> wake_up_q(), I knew you could put it here, but it didn't seem to me to help >> at all. > So you are worried about unbound latencies on !RT. Okay. So for !RT this > does not help but it is not worse then before (before the RT patch was > applied and changed things). > In fact it is better now (with RT patch and this one) because before > that patch you would not only open interrupts between the wake up but you > would leave the function with interrupts open which is wrong. Any > interrupt (or a context switch due to need-resched() that would invoke > percpu_ref_put() would freeze the CPU/system. > Also, every user that invoked swake_up_all() with enabled interrupts > will still perform the wake up with enabled interrupts. So nothing > changes here. Ah, ok, that makes sense.  Sorry, I was mixing things up.  Yes. on RT this should fix the unbounded time issue, and it should also solve the interrupts disabled issue on !RT. I'll try this out. -corey >>>> I had another idea.  This is only occurring if RT is not enabled, because >>>> with >>>> RT all the irq disable things go away and you are generally running in task >>>> context.  So why not have a different version of swake_up_all() for non-RT >>>> that does work from irqs-off context? >>> With the patch above I have puzzle part which would allow to use swait >>> based completions upstream. That ifdef would probably not help. >> I agree that having a bounded time way to wake up a bunch of threads while >> interrupts are disabled would solve a bunch of issues.  I just don't see how >> it >> can be done without pushing it off to a softirq or workqueue. > true but this is a different story. We started with a WARN_ON() which > triggered correctly and the problem it pointed to looks solved to me. > > This "unbounded runtime during the wake up of many tasks with interrupts > disabled via percpu_ref_kill() -> blk_queue_usage_counter_release()" > thing exists already in the vanilla kernel and does not exist > with the RT patch applied and RT enabled. If you are affected by this > and you don't like it - fine. Using a workqueue is one way of getting > around it (the softirq is not preemptible in !RT so it wouldn't change > much). However, I see no benefit in carrying such a patch because as I > said only !RT is affected by this. > >> -corey > Sebastian