Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752579AbbHJM7A (ORCPT ); Mon, 10 Aug 2015 08:59:00 -0400 Received: from smtp.citrix.com ([66.165.176.89]:32553 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbbHJM67 (ORCPT ); Mon, 10 Aug 2015 08:58:59 -0400 X-IronPort-AV: E=Sophos;i="5.15,645,1432598400"; d="scan'208";a="289632438" Date: Mon, 10 Aug 2015 13:57:31 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: David Vrabel CC: Stefano Stabellini , Julien Grall , , , , "Boris Ostrovsky" , Subject: Re: [Xen-devel] [PATCH v3 19/20] xen/privcmd: Add support for Linux 64KB page granularity In-Reply-To: <55C895A8.9020004@citrix.com> Message-ID: References: <1438966019-19322-1-git-send-email-julien.grall@citrix.com> <1438966019-19322-20-git-send-email-julien.grall@citrix.com> <55C895A8.9020004@citrix.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1037 Lines: 26 On Mon, 10 Aug 2015, David Vrabel wrote: > On 10/08/15 13:03, Stefano Stabellini wrote: > > On Fri, 7 Aug 2015, Julien Grall wrote: > >> - rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp); > >> - return rc < 0 ? rc : err; > >> + for (i = 0; i < nr_gfn; i++) { > >> + if ((i % XEN_PFN_PER_PAGE) == 0) { > >> + page = pages[i / XEN_PFN_PER_PAGE]; > > > > If this function is going to be called very frequently you might want to > > consider using a shift instead. > > > > page = pages[i >> 4]; > > > > With an appropriate macro of course. > > This change isn't necessary. Compilers already turn divides into > suitable shifts. The ARM compiler I used last time I tested this did not, but that was 1 or 2 years ago. In any case to be clear this change is not required. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/