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

Re: [PATCH 04/12] swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests


  • To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 8 Sep 2021 11:16:47 +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; bh=5o3MjP4Xyup2z4+VruHsu4pa+Ez3/ZYNop7+qUPcPWU=; b=Gtvc26UtBl36xK/xqvboQlK6LugjpJx+nlHVpZw/VkesP0uaQdZ3GXbspTLilQxP2eTPgXvF3vLo2GKTMGGcpBzI8T7Tig9M8SXYRuaUEpRtEqe38bCyzyXr2JoVxWTNH5iTyNjWtBgfPW8Hdm5/OgVQHqBHLr8PGzDcuRj98rFwdDrjJCxL6WPDvX+UuZtLa9ICUBrKogAJIkpX2txNlTxW1kR/5Am+0qnwsOWa/zjn872jdC07metqq8evut/WdspAgNgCc/Kxxo9aTfhdNH0aSFj4SDBhkKMTo2JXX0w6NFsI+lKh/0lAIpWBJqvLW1qXX/Y4ZSWT3m5SNDaqCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iENznPPznq4lOx7kKxSZ0R6DH6baKoSPmiBe14QQaJiQmCetzQTroOsgkpRXwnRpAHg4nRG97mJ78KAMzexlyIefbfVB2GVAk0k6/Ng/L51Hqy2IU4aMrhoi0wcpo9Qbjd2COm4Ux4vrEBgEwMkrfhtr8WPe75bZzvt5bQ17axpOel+xKKf1rSROgCgtr8C0dhdYQlWLysEo2Wy8Jqc78JeCkmR0bAkNGE2W3r5W+h6Q2NWq//q6sf7m+/kwrbLwuV+Vy3YlIVGjsid0ioJxpK0h0B/aRs0FpfVHYkKrwFJC0bz0xI3sMWZMlgIBXLEOy2AdRqFPX+pjj4Xd1bfQgw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 08 Sep 2021 09:17:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2021 08:57, Christoph Hellwig wrote:
> On Tue, Sep 07, 2021 at 02:05:32PM +0200, Jan Beulich wrote:
>> While the hypervisor hasn't been enforcing this, we would still better
>> avoid issuing requests with GFNs not aligned to the requested order.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> I wonder how useful it is to include the alignment in the panic()
>> message. I further wonder how useful it is to wrap "bytes" in
>> PAGE_ALIGN(), when it is a multiple of a segment's size anyway (or at
>> least was supposed to be, prior to "swiotlb-xen: maintain slab count
>> properly").
>>
>> --- a/drivers/xen/swiotlb-xen.c
>> +++ b/drivers/xen/swiotlb-xen.c
>> @@ -231,10 +231,10 @@ retry:
>>      /*
>>       * Get IO TLB memory from any location.
>>       */
>> -    start = memblock_alloc(PAGE_ALIGN(bytes), PAGE_SIZE);
>> +    start = memblock_alloc(PAGE_ALIGN(bytes), IO_TLB_SEGSIZE << 
>> IO_TLB_SHIFT);
>>      if (!start)
>> -            panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
>> -                  __func__, PAGE_ALIGN(bytes), PAGE_SIZE);
>> +            panic("%s: Failed to allocate %lu bytes align=%#x\n",
>> +                  __func__, PAGE_ALIGN(bytes), IO_TLB_SEGSIZE << 
>> IO_TLB_SHIFT);
> 
> CAn you avoid the overly long lines here?  A good way to make it more
> readable would be a variable to hold the byte count.

There already is a variable for the byte count - bytes. Did you read
the post-commit-message remark? _That's_ what I'd prefer to shorten
things. Meanwhile I can of course wrap lines; I will admit that I
failed to pay attention to line length here.

Jan




 


Rackspace

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