Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp4037614rwp; Sat, 15 Jul 2023 15:11:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHpLNI5k2t2VIGG2npC5mLQPN7sZZWj5PPx+vGnWhIVykq89umwFADfPizGVckfx4qZU5U6 X-Received: by 2002:a17:903:32cf:b0:1b8:a469:53d8 with SMTP id i15-20020a17090332cf00b001b8a46953d8mr11038148plr.0.1689459073391; Sat, 15 Jul 2023 15:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689459073; cv=none; d=google.com; s=arc-20160816; b=hS70nqEpXZi44KXdblIO2C8wRt1op1jleLhqGJguceE+57SDrKcbiAlAHqIEvVLsx5 R7qVShtfiHLTNdY2+TROTF4gbhDE9wxVWAnufFDD/KEi69ZlHiCaVvbELU8jpqS+gVaW MnJmzlKrBwsW0MGYLamQu0Qi1M0Bl4NJfmRo/CBInMlkw5SBPqR2KNUWiG9edR85hRf4 YJFdMyV+9fewTU/9oGz9CT8y/8b5RvQ6Y703LFCKgVYkdu6P4roBhV00D1WPG1at3ONy MMETVo32q36HYx1aw5coNp26MFsuPEFD9qnMt0LoUtN5xMKArHKkP5Kg49d4CWJ3ip1h FoQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tiheNBrs8vbrkhdpnl0RjzLRJqJO+U/Fht49O59nJNw=; fh=0GQwdc1uqcHaVk5UPuNP7JsT1wjoBY6ODqHSgLHLL6g=; b=EyricyI6/FHaM7f+LTbrhc0aY0XDIFkwxDFszs5d9+5ZHPA4hOdFBrZCH7fZ08YCS7 hANmuEUXdzW2wJAI/HpEI/ifBi2q+suCnpchMge66addXiuVrwiYOKhOCZllV4vyqygM zroe2EFfu6m+1/wPNZX8qnOPgS0A1qtD1hjwcGOu4cpp4vygbAzwih722YRQVcjW7HSX 4kNTzyqLU7MxdwMzSxe1zCxD+2gzv+WRCWg6CLi57ih5QXLH/tkcPIl6hXWf8aIQoHwO 1w/lAxFIWaQZ1QpJP1C52Tz36IFRuMeal2zwWtq5Jw5U2I+loep0mb03zBIOcDCnDmUc sfmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hq+0jPzI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg16-20020a170902fb9000b001b3d27c4f48si9267237plb.57.2023.07.15.15.11.00; Sat, 15 Jul 2023 15:11:13 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hq+0jPzI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjGOVrQ (ORCPT + 99 others); Sat, 15 Jul 2023 17:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjGOVrP (ORCPT ); Sat, 15 Jul 2023 17:47:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE788213F; Sat, 15 Jul 2023 14:47:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4274260ACE; Sat, 15 Jul 2023 21:47:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAED7C433C7; Sat, 15 Jul 2023 21:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689457633; bh=0ym6BumiF8nCUMugy8PoUi1Eqilv5DUripcU8/IgzN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hq+0jPzICfhKbIt5EGXlVGPHu/7Id2j2H7y2z/sg10dTDOYulbHHbNx6DcrR3K20F kL8Hmzdd/P/R4ZVwCxRMsd+w8wWknU4tsAt7OfLx4iSt1Ve6s62DHxmz7hG+bAf+gX KFNvY5QCAMqNDltC+NDnxxh6BDIbak6HNLr9NFmAKh3Ynt/pWbQ6rq6iNrkfkGtEZO 0mHpuC5LrSFxoQYiO7FnLgHvHcOGmfnLQ3rJAPQylTj+q86x1WEpsDa0DyjmO3Xc9e /V3RPUQ5b4pauvJibckDN2rKg15bI5oZfiurLf6dip1vkUf8JywculA21r8nWMd65a oAvCLXS4quNhg== Date: Sat, 15 Jul 2023 14:50:41 -0700 From: Bjorn Andersson To: Manikanta Mylavarapu Cc: agross@kernel.org, konrad.dybcio@linaro.org, mathieu.poirier@linaro.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, quic_srichara@quicinc.com, quic_sjaganat@quicinc.com, quic_kathirav@quicinc.com, quic_anusha@quicinc.com, quic_varada@quicinc.com Subject: Re: [PATCH 2/2] rpmsg: glink: change intent work queue type Message-ID: <5tll34ehog7smsenaskcd7j2uqgcpgmobvortf6no4ebu6ylqr@vkqtajhuri2t> References: <20230607121731.26958-1-quic_mmanikan@quicinc.com> <20230607121731.26958-3-quic_mmanikan@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607121731.26958-3-quic_mmanikan@quicinc.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Wed, Jun 07, 2023 at 05:47:31PM +0530, Manikanta Mylavarapu wrote: > QDSP6 will clear heap memory once it's received > RX_DONE event from APPS. Under heavy cpu load > intent worker thread not able to get cpu slot > because it's bound to kernel global work queue. > Due to this QDSP6 firmware faces OOM and it leads > to Q6 crash. Changing intent work queue type to > UNBOUND workqueue ensures intent worker thread > will be executed as early as possible. > This commit message is specific and the motivation is clear, thank you! I was hoping to move the rx_done generation directly to qcom_glink_rx_data(), but I got side tracked on my verification of my patches for this. Please update the alloc_workqueue() and we can merge this first, if I haven't gotten favourable test results until then. PS. 75 character commit messages please. Regards, Bjorn > Signed-off-by: Manikanta Mylavarapu > --- > drivers/rpmsg/qcom_glink_native.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c > index 6f9a439e5046..c3e076bb863f 100644 > --- a/drivers/rpmsg/qcom_glink_native.c > +++ b/drivers/rpmsg/qcom_glink_native.c > @@ -140,6 +140,7 @@ enum { > * @liids: idr of all local intents > * @riids: idr of all remote intents > * @intent_work: worker responsible for transmitting rx_done packets > + * @intent_wq: work queue of intent_work > * @done_intents: list of intents that needs to be announced rx_done > * @buf: receive buffer, for gathering fragments > * @buf_offset: write offset in @buf > @@ -169,6 +170,7 @@ struct glink_channel { > struct idr liids; > struct idr riids; > struct work_struct intent_work; > + struct workqueue_struct *intent_wq; > struct list_head done_intents; > > struct glink_core_rx_intent *buf; > @@ -231,6 +233,14 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink, > INIT_LIST_HEAD(&channel->done_intents); > INIT_WORK(&channel->intent_work, qcom_glink_rx_done_work); > > + channel->intent_wq = alloc_workqueue("intent_wq", WQ_UNBOUND, 1); > + if (!channel->intent_wq) { > + pr_err("failed to create %s channel intent work queue\n", > + channel->name); > + kfree(channel); > + return ERR_PTR(-ENOMEM); > + } > + > idr_init(&channel->liids); > idr_init(&channel->riids); > kref_init(&channel->refcount); > @@ -270,6 +280,7 @@ static void qcom_glink_channel_release(struct kref *ref) > idr_destroy(&channel->riids); > spin_unlock_irqrestore(&channel->intent_lock, flags); > > + destroy_workqueue(channel->intent_wq); > kfree(channel->name); > kfree(channel); > } > @@ -573,7 +584,7 @@ static void qcom_glink_rx_done(struct qcom_glink *glink, > list_add_tail(&intent->node, &channel->done_intents); > spin_unlock(&channel->intent_lock); > > - schedule_work(&channel->intent_work); > + queue_work(channel->intent_wq, &channel->intent_work); > } > > /** > -- > 2.17.1 >