[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grant operation batching


  • To: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 May 2022 14:44:45 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iHuxhy7yweiZSN67XVLHur0kY5HDi7JRRSlgZscP/k4=; b=Tr3bRj52O7m4xvos3dOlRVZalqcaPddYT3lu/k28KCp675EuSihrjL7jA6yrDfg1Zp8i2lWSIYRk+f487sI08yulCHmzReU/dwWruAhAsKkds55Tegwu+MVzKZY9V/3vLDI5pK+O94G3mpTAmz2NrQnx6s+ckWDmypby5LignEFKti4QYDYFeYoWZm/PCsbpwErXJZd5TBPVHx1cSWCaYFisZLw6TfuP6FE8qjuyrHJCca93udmiLPwl6KJ2CfCU9qH01iefxuU4C+/mXKnbt6hPYrQC+jzbdtlYr4Lg9a54XfeWR8xOWFeW+cYbhQJb/HXVOcnOmA2vadBHeCwlxw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SovPfNRLfZvgDo4Oye7nLSy3au27lWEsvpmC+U0jKxcVc4/ePl8e9QoBvsxd0pXlLc9DPmFZnZWXYfEUis0C4o9HkS8jaYCyyYGzdRaqy38b4nIgybPF7JaHxSGimmyJELoxbImfHVYSMeAO7GpwdOEbh3e5/mvMRAtHOW+XxZAo0qb4KyxYgEKQ4gaHcUPwhOLbd5lWeV2Nt0OyUiV9nU2I0I6iD+kIoyHCvXhuw8Se8DkDgT6HHW3EDNym5XJ3+fJTuAGs2gWqC8JlVldN56N2LQhy9UWzWYyU1v18OAr83hOhk5VwDq3vD4OxVZ+C/Url6c+o61DxH45FRhrhsA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 20 May 2022 12:44:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.05.2022 14:37, Demi Marie Obenour wrote:
> On Fri, May 20, 2022 at 08:24:48AM +0200, Jan Beulich wrote:
>> On 20.05.2022 01:22, Demi Marie Obenour wrote:
>>> It is well known that mapping and unmapping grants is expensive, which
>>> is why blkback has persistent grants.  Could this cost be mitigated by
>>> batching, and if it was, would it affect the tradeoff of memcpy() vs
>>> grant table operations?
>>
>> Which backend driver are you thinking about? The in-kernel Linux
>> xen-blkback already batches grant operations, afaics. Such
>> batching is helpful, but the main cost is assumed (known?) to be
>> with the (installing and) tearing down of the actual mappings of
>> the guest pages (into/)from backend address space.
> 
> My thought was that the expensive part of this is TLB flushes, which are
> only needed once per batch.

Correct, but as said - such batching is already being made use of by
the in-kernel Linux backend. Of course "once per batch" is not entirely
precise - very large batches would be split internally into smaller
chunks, each of which would be followed by a TLB flush.

>  Also, what do you think about the “unsafe”
> mode?  It would only be unsafe if the backend is untrusted, but it is
> quite common for the backend to be trusted.

Well, I didn't put much thought into that (and hence intentionally
didn't comment on it), so for now it's only "Why not?"

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.