Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4028112pxk; Tue, 22 Sep 2020 08:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywJ0HhK3QnN3HqUlULedfV5FmjMthR+NKDGUjY86umoDJnjI/YI5sLTwoA5MIwFvyjWFvA X-Received: by 2002:a17:906:275b:: with SMTP id a27mr5922994ejd.190.1600789006652; Tue, 22 Sep 2020 08:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600789006; cv=none; d=google.com; s=arc-20160816; b=wLK0cXOnq8ZQuod0Wm5jTeC/0DfyqyvKfBPMza1ydNpq6A5l2F/4yAHsCUg/4kpbjP 9GYN3fVwg85Q65gTu/m9OHz6p7JgZocp6NyULDASs/a6lH37yBgPuOE8fnE1bcc1H8aA pAZlfTiCQl+kgcHuA2vp8LKJipZX2sJmuFxfDMD91SEmoSWUyH6IYouzPOBtjHkreciy SBVFsx6wMvRN9MWXTQZibSJ0A3n3giFOJ+r++JMEsW+gxck30YVHnxMB//z9fxm9Hral dDrx5ER7uI2ay0ees4qlN7tfxmT4ntCnddivvdRVcTdm+RFw+ExojJjOXZBXZACabLnc rhRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=SQUZRxKbOrj7C5f6uXB0QaPDAWtQi5hHWGb3AMCGwok=; b=IF5BICjJKacWJqJWCHh1trkzeKlsOjpH2a0xkZVGpQAWXwPmbjA+Zifbv4c+BXhMqW gOLb/vsUptI5+E7eDBKDLdv+VnjaGFgMnad+85DcrYpJ5jCGhgqsuW16W0qKFv5Z9DPS XEpzh2KUnKwRN6s2AW10JunphxOqrrOLuRr6WiQuDsdcwzMMIz7CKUtiHQAOZclC+6Hn EMwx4lg6Izsa7MKHILKWWYbSh1oMQ9tHCzYEgQ5tyTWSa0qDtThnqMWpBlIQTczXpioD /ULWWZ1eXnayG4DlA817FqPb/mkOM0V8b1p/En27O5OT1dG8ImQET3jmkBhahHjNlVCo SbqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=vXNxTqEa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si7905023ejx.235.2020.09.22.08.36.20; Tue, 22 Sep 2020 08:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=vXNxTqEa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbgIVPfB (ORCPT + 99 others); Tue, 22 Sep 2020 11:35:01 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57024 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgIVPfB (ORCPT ); Tue, 22 Sep 2020 11:35:01 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08MFXZ4A115377; Tue, 22 Sep 2020 15:34:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=SQUZRxKbOrj7C5f6uXB0QaPDAWtQi5hHWGb3AMCGwok=; b=vXNxTqEaODuD+fyU1jUL8sgHm/70CoNspaljF2CVJy8YCkwoU79BXOLKh267UZHkplF8 8gDxgeFrbFB3MPy3LpGLNkXfd1SvSHwK+Aa1BHsHL6vvwsYit9kqi55PmIfQ5VEjTtfj xYG2uDen9YZs91OrBwjVJcj7oFo6Mv3iUblQ43Pm81r+jgqhZ/1Tcx8D1VYYb7+x69fb n+qGpLjCo2XbRGqid1wVg1IbrdOhxG/60xd/nbbzTVHN4KXX5ILRDFS7r3qd1qqYr6Ez qQJnMwFLIBPdG4ZIkFCq9APz0yHuY8A6pTbvyMU5RcXkzUXKRKPdNqjFklU4rSPXqE1a Hw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 33ndnudj4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 Sep 2020 15:34:42 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08MFURVL072451; Tue, 22 Sep 2020 15:34:41 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 33nujncaex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Sep 2020 15:34:41 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08MFYdJl019605; Tue, 22 Sep 2020 15:34:39 GMT Received: from [10.74.86.236] (/10.74.86.236) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Sep 2020 08:34:38 -0700 Subject: Re: [PATCH 6/6] x86/xen: open code alloc_vm_area in arch_gnttab_valloc To: Christoph Hellwig Cc: Andrew Morton , Peter Zijlstra , Juergen Gross , Stefano Stabellini , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Minchan Kim , Nitin Gupta , x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org References: <20200918163724.2511-1-hch@lst.de> <20200918163724.2511-7-hch@lst.de> <0833b9a8-5096-d105-a850-1336150eada1@oracle.com> <20200922145819.GA28420@lst.de> <20200922152706.GA30633@lst.de> From: boris.ostrovsky@oracle.com Organization: Oracle Corporation Message-ID: Date: Tue, 22 Sep 2020 11:34:35 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.2.1 MIME-Version: 1.0 In-Reply-To: <20200922152706.GA30633@lst.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9752 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009220121 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9752 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 suspectscore=0 bulkscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009220121 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/22/20 11:27 AM, Christoph Hellwig wrote: > On Tue, Sep 22, 2020 at 11:24:20AM -0400, boris.ostrovsky@oracle.com wrote: >> On 9/22/20 10:58 AM, Christoph Hellwig wrote: >>> On Mon, Sep 21, 2020 at 04:44:10PM -0400, boris.ostrovsky@oracle.com wrote: >>>> This will end up incrementing area->ptes pointer. So perhaps something like >>>> >>>> >>>> pte_t **ptes = area->ptes; >>>> >>>> if (apply_to_page_range(&init_mm, (unsigned long)area->area->addr, >>>>                         PAGE_SIZE * nr_frames, gnttab_apply, &ptes)) { >>>> >>>>        ... >>> Yeah. What do you think of this version? >> >> Oh yes, this is way better. This now can actually be read without trying to mentally unwind triple pointers. (You probably want to initialize idx to zero before calling apply_to_page_range(), I am not sure it's guaranteed to be zero). > Both instances are static variables, thus in .bss and initialized. > So unless you insist I don't think we need a manual one. Yes, you are right. (I thought perhaps this code could be called more than once but no, it can't). -boris