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=-6.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 D2639C282DE for ; Wed, 5 Jun 2019 07:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A2F42075C for ; Wed, 5 Jun 2019 07:33:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="p47Tf+Fr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726653AbfFEHdV (ORCPT ); Wed, 5 Jun 2019 03:33:21 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:44838 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726464AbfFEHdV (ORCPT ); Wed, 5 Jun 2019 03:33:21 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x557RTD3028451; Wed, 5 Jun 2019 09:33:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=kgiD5DsEkdJ2rPmS1bY7rGKG5TseCbpWmlOHsd3SkeU=; b=p47Tf+FrWqSUFqFeXCqvGz+9VUfT3KkMMkuNuwIF68Aia+CjH3rby5g/8qL9muDVi/t1 Yb5FkegG5BQAa6pSnBD09Q16oZfRhVx1AnGcui2gMsW6eJhvZyajeI8PYuYNt+GWxh8/ S6Ajioanc6goaoKqpwREDRbVR3vwRU9MgvlgnGwZnl+/n+2jTb8dV9qKs4137EB9oKy5 zgTkrwzEeO0DP68s7lpab42M6LPYwOdwaxB8d8lkKFR4pKJuvgy0usXJiys7BNYO9dOp JfaAJE9xkKBl/z362nDfEMIFKg9tn/ywZUhvKSAI/Zg1l/xLiL6ABrMZwQLgNkhSQp2B HA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sunds55jj-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 05 Jun 2019 09:33:18 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DC94738; Wed, 5 Jun 2019 07:33:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A7F27161A; Wed, 5 Jun 2019 07:33:16 +0000 (GMT) Received: from [10.48.0.131] (10.75.127.44) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 5 Jun 2019 09:33:15 +0200 Subject: Re: [PATCH 0/3] Enhance virtio rpmsg bus driver buffer allocation To: Bjorn Andersson , Xiang Xiao CC: , , , , Xiang Xiao References: <1548949280-31794-1-git-send-email-xiaoxiang@xiaomi.com> <20190605043452.GI22737@tuxbook-pro> From: Arnaud Pouliquen Openpgp: preference=signencrypt Autocrypt: addr=arnaud.pouliquen@st.com; prefer-encrypt=mutual; keydata= xsFNBFZu+HIBEAC/bt4pnj18oKkUw40q1IXSPeDFOuuznWgFbjFS6Mrb8axwtnxeYicv0WAL rWhlhQ6W2TfKDJtkDygkfaZw7Nlsj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R AQABwsFlBBgBAgAPBQJWbvhyAhsMBQkJZgGAAAoJEP0ZQ+DAfqbfs5AQAJKIr2+j+U3JaMs3 px9bbxcuxRLtVP5gR3FiPR0onalO0QEOLKkXb1DeJaeHHxDdJnVV7rCJX/Fz5CzkymUJ7GIO gpUGstSpJETi2sxvYvxfmTvE78D76rM5duvnGy8lob6wR2W3IqIRwmd4X0Cy1Gtgo+i2plh2 ttVOM3OoigkCPY3AGD0ts+FbTn1LBVeivaOorezSGpKXy3cTKrEY9H5PC+DRJ1j3nbodC3o6 peWAlfCXVtErSQ17QzNydFDOysL1GIVn0+XY7X4Bq+KpVmhQOloEX5/At4FlhOpsv9AQ30rZ 3F5lo6FG1EqLIvg4FnMJldDmszZRv0bR0RM9Ag71J9bgwHEn8uS2vafuL1hOazZ0eAo7Oyup 2VNRC7Inbc+irY1qXSjmq3ZrD3SSZVa+LhYfijFYuEgKjs4s+Dvk/xVL0JYWbKkpGWRz5M82 Pj7co6u8pTEReGBYSVUBHx7GF1e3L/IMZZMquggEsixD8CYMOzahCEZ7UUwD5LKxRfmBWBgK 36tfTyducLyZtGB3mbJYfWeI7aiFgYsd5ehov6OIBlOz5iOshd97+wbbmziYEp6jWMIMX+Em zqSvS5ETZydayO5JBbw7fFBd1nGVYk1WL6Ll72g+iEnqgIckMtxey1TgfT7GhPkR7hl54ZAe 8mOik8I/F6EW8XyQAA2P Message-ID: <2d60dd1e-f7a0-ea63-9fda-0ea97aab0406@st.com> Date: Wed, 5 Jun 2019 09:33:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190605043452.GI22737@tuxbook-pro> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG1NODE3.st.com (10.75.127.3) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-05_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, On 6/5/19 6:34 AM, Bjorn Andersson wrote: > On Thu 31 Jan 07:41 PST 2019, Xiang Xiao wrote: > >> Hi, >> This series enhance the buffer allocation by: >> 1.Support the different buffer number in rx/tx direction >> 2.Get the individual rx/tx buffer size from config space >> >> Here is the related OpenAMP change: >> https://github.com/OpenAMP/open-amp/pull/155 >> > > This looks pretty reasonable, but can you confirm that it's possible to > use new firmware with an old Linux kernel when introducing this? > > > But ever since we discussed Loic's similar proposal earlier I've been > questioning if the fixed buffer size isn't just an artifact of how we > preallocate our buffers. The virtqueue seems to support arbitrary sizes > of buffers and I see that the receive function in OpenAMP has been fixed > to put back the buffer of the size that was received, rather than 512 > bytes. So it seems like Linux would be able to send whatever size > messages to OpenAMP it would handle it. > > The question is if we could do the same in the other direction, perhaps > by letting the OpenAMP side do it's message allocation when it's > sending, rather than Linux pushing inbufs to be filled by the remote. IMHO, both could be useful and could be not correlated. On-the fly buffer allocation seems more efficient but needs an allocator.This can be a generic allocator (with a va to da) for system where large amount of memories are accessible from both side. Now what about system with small shared memory? In this case you have to deal with a limited/optimized memory chunk. To avoid memory fragmentation the allocator should have a pre-reserved buffers pool(so similar to existing implementation). This serie seems useful to optimize the size of the pre-reserved pool. > > This would remove the problem of always having suboptimal buffer sizes. > > Regards, > Bjorn > >> Xiang Xiao (3): >> rpmsg: virtio_rpmsg_bus: allow the different vring size for send/recv >> rpmsg: virtio_rpmsg_bus: allocate rx/tx buffer separately >> rpmsg: virtio_rpmsg_bus: get buffer size from config space >> >> drivers/rpmsg/virtio_rpmsg_bus.c | 127 +++++++++++++++++++++++--------------- >> include/uapi/linux/virtio_rpmsg.h | 24 +++++++ >> 2 files changed, 100 insertions(+), 51 deletions(-) >> create mode 100644 include/uapi/linux/virtio_rpmsg.h >> >> -- >> 2.7.4 >> -- Regards, Arnaud