Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6428404ybi; Wed, 5 Jun 2019 00:34:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAAxf2pyHiGg93WZROVtw7R8b3JqKSdna1i4EsMubBqQekKNTZK3YypBihrnbuKqbDXiQk X-Received: by 2002:a63:5b5d:: with SMTP id l29mr2619045pgm.444.1559720089566; Wed, 05 Jun 2019 00:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559720089; cv=none; d=google.com; s=arc-20160816; b=TqOavFLLa6YSgLRYYAWIeF8MlifpRWl39GL4rYDDeFVxeqF2zOwOJV0eYJCJI7xFb3 ekiUK8WNNFQMYLqJZPkn8dxIl6RUyMMLU8s3k2v8iA6Hn3PyDTOJAeS5iddW04sSgju+ W5uoyk2QsvxFwSiNOXqyipt7qKphUcdYrTfVfNf3o/i7Cnj+WunCgyd06XJHfwbiLqX4 KaceF1hWaVUbchVs3e/BMjWHHv5U4IWafZrPxxbzjThzkoKozJoIAx4naDk08RkIQzKs wFvYGvVa+UReZEhtjQAojkfliPjUX71YnWoNCMZg0RmeKVqAp12eVY3FpR05v/mQrBp4 mB5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=kgiD5DsEkdJ2rPmS1bY7rGKG5TseCbpWmlOHsd3SkeU=; b=Ob+jtvtix8hU765D2lslZS83ujtF+annOHT4xdVdjum+olNOIEwHK7rXwFjenx7AHT fbTiWur9kAvl5xXEKjFxO7mor68oD06wbWq7Zg+EQOhEYUU7exWESLItffd5gwK3a8GT lTSVX7f6PjWni+q9163cNC6plkUFwJ6SKZ2jgpsitJ6Omk3jxLvUqZwACrArL9PGYd7j UY7+Nt9P8HH3Bq/04uNKFXjs7ReZHRfEHkCUtnnHaTp+eXcUFyg2a8xlp3cKc4k5+Zl4 kZsdnpA2JT0vkRzYah8i2XMECfwWK4yIUeYxyT+68lwqQNbKSu+6EpkPLM9oBiLSYkbz jY2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=p47Tf+Fr; 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 m25si23834672pgv.481.2019.06.05.00.34.31; Wed, 05 Jun 2019 00:34:49 -0700 (PDT) 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=@st.com header.s=STMicroelectronics header.b=p47Tf+Fr; 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 S1726645AbfFEHdV (ORCPT + 99 others); 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/bt4pnj18oKkUw40q1IXSPeDFOuuznWgFbjFS6Mrb8axwtnxe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XqR+YR86JPrzw2zjgr1e2zCZ1gHBTOyJZiDwAR 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