Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1191253ybg; Thu, 11 Jun 2020 03:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkzm3vQpkTZgJjGexmiSnnGFhfR3DYDUnCDxNNH97TvLYZDwMgHiTvxSTsWj1oH8RIs7HB X-Received: by 2002:a17:906:11c4:: with SMTP id o4mr8030851eja.163.1591871255114; Thu, 11 Jun 2020 03:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591871255; cv=none; d=google.com; s=arc-20160816; b=JQMdOYFxVI2FY+yMQUu76OYjyBWu7IVh4qBN9YSL2tpin6VXYrxdIUUqfNk1ja+GHC PMIVRLKVsNL6971qBTzPBR5zJXt44Jw/qkKTIMr6Re+EvWF0Sf5UPJHuGz3/tVDPlNEp DOBCIJNeNPAnjCqcXZGLef+ywX3hLFeQUrHYG5N4uRyykk1nqZerJLl8vQMmkb4Wwy4J 9pwLncBWbyRYBAm5SJaRmpHcrxT3GWVSYTUEsjeWtCT5Ll3YSwZ7Xe8qxv2L7yRY43oI iuajfVzRk7f2uj+9CrYUs75p1HByUcpLB27eZNIitcQEkCQ0kN4y187K2YEXhjU/x5RH 7Gig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3s/3f9+t5lDjImyN1qebTtkSmXGG1BJq4fV9up6KlQA=; b=Cskoe+w3t7y0HrYvorJEwFHZqm+OYtLG30X42VrdkWSMqj3/otfbpuDiN3g/lkV0Cn DtC0k2IFgKGuG+pvXMiPYI5sOaGUj2TlGGzkEj/iS9EoKyTobtwaXrXuBivUIe0J4hZN t2QaERm3GaMbV7D7qsGRYlGhjK2y5iL2h3N6MzCa3HM7xZLBy9YLisxurFI5IUANglAk tDbM07TVxUcdWFDxPi3UmQPseAgbJbCW21vbEu8pfiULFQs3V5LZicJdRk29fGhMRkqt x2BBcNz5s1Q2nm8IJswCfoOgFAfrvcfhGk37hNgKNEOitw1njMsi8bUxV2/NjetSyJno PrLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si1399031edn.360.2020.06.11.03.27.12; Thu, 11 Jun 2020 03:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727068AbgFKKAe (ORCPT + 99 others); Thu, 11 Jun 2020 06:00:34 -0400 Received: from foss.arm.com ([217.140.110.172]:49658 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbgFKKAc (ORCPT ); Thu, 11 Jun 2020 06:00:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D0A6231B; Thu, 11 Jun 2020 03:00:31 -0700 (PDT) Received: from bogus (unknown [10.37.12.97]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 92CE23F73D; Thu, 11 Jun 2020 03:00:29 -0700 (PDT) Date: Thu, 11 Jun 2020 11:00:27 +0100 From: Sudeep Holla To: Viresh Kumar Cc: Jassi Brar , Rob Herring , Arnd Bergmann , Frank Rowand , Bjorn Andersson , Vincent Guittot , linux-arm-kernel , Sudeep Holla , Devicetree List , Linux Kernel Mailing List Subject: Re: [RFC] dt-bindings: mailbox: add doorbell support to ARM MHU Message-ID: <20200611100027.GB18781@bogus> References: <20200529040758.kneg2j4n3gxh2rfv@vireshk-i7> <20200603180435.GB23722@bogus> <20200604092052.GD8814@bogus> <20200605045645.GD12397@bogus> <20200605085830.GA32372@bogus> <20200610093334.yznxl2esv5ht27ns@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610093334.yznxl2esv5ht27ns@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, Thanks for summarising the thoughts quite nicely. On Wed, Jun 10, 2020 at 03:03:34PM +0530, Viresh Kumar wrote: > On 05-06-20, 10:42, Jassi Brar wrote: > > Since origin upto scmi_xfer, there can be many forms of sleep like > > schedule/mutexlock etc.... think of some userspace triggering sensor > > or dvfs operation. Linux does not provide real-time guarantees. Even > > if remote (scmi) firmware guarantee RT response, it makes sense to > > timeout a response only after the _request is on the bus_ and not > > when you submit a request to the api (unless you serialise it). > > IOW, start the timeout from mbox_client.tx_prepare() when the > > message actually gets on the bus. > > There are multiple purposes of the timeout IMO: > > - Returning early if the other side is dead/hung, in such a case the > timeout can be put when the request is put on the bus as we don't > care of the time it takes to complete the request until the time the > request can be fulfilled. This can be a example of i2c/spi memory > read. > > - Ensuring maximum time in which the request needs to be serviced. > There may be hard requirements, like in case for DVFS from > scheduler's hot path (which is essential for better working of the > overall system). And for such a case the timeout is placed at the > right place IMO, i.e. right after a request is submitted to mailbox. > Agreed on both points. > And some more points I wanted to share.. > > - I am not sure I understood the *serializing* part you guys were > talking about. I believe mailbox framework is already serializing > the requests it is receiving on a single channel with a spin lock, > right ? Why does the client need to serialize them as well? Is that > for avoiding timeouts ? > > - For me, and Sudeep as well IIUC, the bigger problem isn't that > timeouts are happening and requests are failing (and so changing the > timeout to a bigger value isn't going to fix anything), but the > problem is that it is taking too long (because of the queue of > requests on a channel) for a request to finish after being > submitted. Scheduler doesn't care of the underneath logistics for > example, all it cares for is the time it takes to change the > frequency of a CPU. If you can do it fast enough in a guaranteed > manner, then you can use fast switching, otherwise not. > > - The hardware can very well support the case today where this can be > done in parallel and (almost) in a guaranteed time-frame. While the > software wants to add a limit to that and so wants to serialize > requests. > +1 > - As many people have already suggested it (like me, Sudeep, Rob, > maybe Bjorn as well), it seems silly to not allow driving the h/w in > the most efficient way possible (and allow fast cpu switching in > this case). > > > Interesting logs ! The time taken to complete _successful_ requests > > are arguably better in bad_trace ... there are many <10usec responses > > in bad_trace, while the fastest response in good_trace is 53usec. > > Indeed this is interesting. It may be worth looking (separately) into > why don't we see those 3 us long requests anymore, or maybe they were > just not there in the logs. > As I mentioned in another thread that non-dvfs requests may be prioritised lower when there are parallel request to the remote. The so called bad trace doesn't have such scenario with single channel and all requests from OS being serialised. The good trace has 2 channels and requests to remote happen in parallel and hence it is fair to see slightly higher latencies for lower priority requests. -- Regards, Sudeep