Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1447936pxb; Mon, 11 Oct 2021 06:18:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw10rtWVDcoxRYwyXE5DQE2AuDwqnQbqpOuDep5umaKwCUzcUldxrxYu9tdfAn9kEVYSIGM X-Received: by 2002:a17:906:5e52:: with SMTP id b18mr12075015eju.560.1633958299784; Mon, 11 Oct 2021 06:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633958299; cv=none; d=google.com; s=arc-20160816; b=ITYhdCxRZEGnUmcnTutjwdyarXX+uIshaKw1C2WPY1YKkpT3wqnPQhaUgDX/CQ1GG0 /aYPF3sNHCjV0km/EgEsOMg6/9C6UE2w2RQNCxntXAtDFOJ7Yqa0grrGt7AEQCUnBttI JE1NkUS8IB4/MdMH3kkgIZJkyXkbzaqHm5BBsQM65ifZ2JqWocbUOAeLYSFRQGwHSHk8 59xbZ5+y0nZ7WWLYsOsKIF6Ro16hH7P6HSG8sdxDUUbZ7H/w3fnfdX/89i7scvxgRMH3 T1t1I9XurLYxJNEV0PVI/8o3GUPrHfg+WMZsGdbeo7FPdCO2fyMxikl6PrVcQfH3bnKU wMQQ== 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:dkim-signature; bh=vGneKOC24QuMCjEYWlUBU8VDrtxfsIr1RhnhAhHHF+M=; b=Ff7cL+OeL89EWCbMe/bA63K76ozLKW1+A4k5DkgF/RqdiGwLiramWcxCdHfnJLm8w9 cylEwjkxlD4JrAI/PhzmmkFK7ITKDftunmxZ/jyuix3xeotmwE/8TvjAWA2We3oWFi3L WZSy1+m2nWWTePRKSIGMP4+aBnahcL/lwkwddadZDwwuV27qKyiADR7xcj8YV+jBurt6 8kChRZ4oO1+ri+SQIrot7ebKTYLVkMPt2YyOd94wP3vPKyA8vkJSr0ULlK++6mr/JdjS EFJJYcKFx2+1dFRZTQ4Sn1BlcaHpzz8tQU3AMlc0CZo/HlvA+61ApsPkwmzm7AWzeZyN iPpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="D/Cqcjmk"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y89si11137366ede.267.2021.10.11.06.17.55; Mon, 11 Oct 2021 06:18:19 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b="D/Cqcjmk"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235365AbhJKJBN (ORCPT + 99 others); Mon, 11 Oct 2021 05:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235182AbhJKJBM (ORCPT ); Mon, 11 Oct 2021 05:01:12 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8A9C061570; Mon, 11 Oct 2021 01:59:13 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id kk10so12778095pjb.1; Mon, 11 Oct 2021 01:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vGneKOC24QuMCjEYWlUBU8VDrtxfsIr1RhnhAhHHF+M=; b=D/CqcjmkD+qbGKq75suNcj8TDyKFRdiYRHYuk0BPHs/eieJoB1wipP4/amVUpx3l2j vPt+79WMN7Py1lY8Z4Q8E3b/VeI3RxfYiIoqm22+HwEU1NPERMvsfwLPKRyaqrTQ6GBA 6gy70m9iYD+s47FwXoh9567WCy4XbDZ5AwThlNwhKAg8yr9/TWuSTnhakvUpFDHrgU86 xqNFmIX5DlZb/P6Lg6zjRge2yqq+2ib9NP5qNd5LnK8YQpCdtrWR85IvpeoOxdNEU2vq 8SPCY+/J5NRNMuLA98wAb86QUvnDl6dKvyDupSZJWgEA3m+wytYWClhvXT753B1WsUn5 s2+Q== 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=vGneKOC24QuMCjEYWlUBU8VDrtxfsIr1RhnhAhHHF+M=; b=mYhKhpk5ORbwCUyULXOf/hr066luBUAA9DBQpHf6f7iB2LJg71mL6gs16uQfr/C+ey 5jabRVDo6C3eEqeHHVLDRP9tmSXcfw+0C9Sjd8nU7SgNWhHRrjZYVdVV7qhKguDHuA+U Rigu9lwPoax8vBXittTaxZPq6fE/OZrpn1NGtiGBox64B8YWh7BUKEdHtWJ+df5vCW6q E9VQziH5imVNKYHp6+anWVlws+MAkakiSEWOO3srksk/bq3HfuvQcQN41IzUUDazaKZn +TkkWapKebLrJYswLXCyL7qRotMjAmglF4C2GUsc/Bot2wJ9H/63VFgNi0a/zel+PkJH fOAA== X-Gm-Message-State: AOAM530YwYJCYFpzeg7HtqzBDapooBZwqGCc+E8/yv3d2ZWCW06yliWD jo/pSOPCGL53yb2AkubHrn2L70L9PbViKsunym2RkFVg X-Received: by 2002:a17:90a:cd:: with SMTP id v13mr29462760pjd.81.1633942752653; Mon, 11 Oct 2021 01:59:12 -0700 (PDT) MIME-Version: 1.0 References: <20210928132902.1594277-1-aardelean@deviqon.com> In-Reply-To: From: Alexandru Ardelean Date: Mon, 11 Oct 2021 11:59:01 +0300 Message-ID: Subject: Re: [PATCH] rpmsg: virtio_rpmsg_bus: use dev_warn_ratelimited for msg with no recipient To: Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, LKML , Ohad Ben Cohen , Mathieu Poirier Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 12:40 PM Alexandru Ardelean wrote: > > On Wed, Sep 29, 2021 at 12:33 AM Bjorn Andersson > wrote: > > > > On Tue 28 Sep 08:29 CDT 2021, Alexandru Ardelean wrote: > > > > > From: Alexandru Ardelean > > > > > > Even though it may be user-space's fault for this error (some application > > > terminated or crashed without cleaning up it's endpoint), the rpmsg > > > communication should not overflow the syslog with too many messages. > > > > > > A dev_warn_ratelimited() seems like a good alternative in case this can > > > occur. > > > > > > > Is there anything a user could/should do when they see this entry in > > their log? > > Not really, no. > The userspace application would need to respawn, or some systemd (or > similar process manager) would need to respawn the application it > should recover the state, and communication should resume normally. > I think this message is good mostly as informative. > > > > > It doesn't look very actionable to me, should we perhaps degrade it > > further to just a dev_dbg()? > > It's not actionable unfortunately. > But I feel it is useful to have this message, until the application recovers. > Mostly to be informative. > A more robust mechanism would be to setup some counters, where we > count the number of missed messages. > And then access this counter via sysfs or something. > > The problem is that a high-rate of dev_warn() (during failure), > temporarily increases system CPU usage & load-average, making the > recovery a bit slower, because systemd-journald is processing these > messages from the kernel. > So, dev_dbg() would definitely help, but would also require us to bump > the system log-level to see the messages. > And if they occur and we don't see them, it causes more questions and > debugging, because people won't know for sure what the issue is. > > Ultimately, dev_dbg() or dev_warn_rate_limited() are both fine. > The goal is to avoid the temporary increase in CPU load. > I just wanted to state my arguments for dev_warn_ratelimite() :) > Ping on this :) > Thank you > Alex > > > > > Regards, > > Bjorn > > > > > Signed-off-by: Alexandru Ardelean > > > --- > > > drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c > > > index 8e49a3bacfc7..546f0fb66f1d 100644 > > > --- a/drivers/rpmsg/virtio_rpmsg_bus.c > > > +++ b/drivers/rpmsg/virtio_rpmsg_bus.c > > > @@ -749,7 +749,7 @@ static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev, > > > /* farewell, ept, we don't need you anymore */ > > > kref_put(&ept->refcount, __ept_release); > > > } else > > > - dev_warn(dev, "msg received with no recipient\n"); > > > + dev_warn_ratelimited(dev, "msg received with no recipient\n"); > > > > > > /* publish the real size of the buffer */ > > > rpmsg_sg_init(&sg, msg, vrp->buf_size); > > > -- > > > 2.31.1 > > >