From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/mm: Ensure useful progress in alloc_l2_table() Date: Wed, 3 Jul 2013 13:20:37 +0100 Message-ID: <51D41715.2040402@citrix.com> References: <1372851428-3696-1-git-send-email-andrew.cooper3@citrix.com> <51D4325302000078000E27C6@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51D4325302000078000E27C6@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir , Xen-devel List-Id: xen-devel@lists.xenproject.org On 03/07/13 13:16, Jan Beulich wrote: >>>> On 03.07.13 at 13:37, Andrew Cooper wrote: >> --- a/xen/arch/x86/mm.c >> +++ b/xen/arch/x86/mm.c >> @@ -1278,13 +1278,6 @@ static int alloc_l2_table(struct page_info *page, unsigned long type, >> >> for ( i = page->nr_validated_ptes; i < L2_PAGETABLE_ENTRIES; i++ ) >> { >> - if ( preemptible && i && hypercall_preempt_check() ) >> - { >> - page->nr_validated_ptes = i; >> - rc = -EAGAIN; >> - break; >> - } >> - >> if ( !is_guest_l2_slot(d, type, i) || >> (rc = get_page_from_l2e(pl2e[i], pfn, d)) > 0 ) >> continue; >> @@ -1299,6 +1292,14 @@ static int alloc_l2_table(struct page_info *page, unsigned long type, >> } >> >> adjust_guest_l2e(pl2e[i], d); >> + >> + if ( preemptible && i != L2_PAGETABLE_ENTRIES > if ( preemptible && i != L2_PAGETABLE_ENTRIES - 1 > > But an even smaller change would be to change the if() you remove > above to > > if ( preemptible && i > page->nr_validated_ptes && > hypercall_preempt_check() ) > > Jan So it will - I shall resend v2 ~Andrew > >> + && hypercall_preempt_check() ) >> + { >> + page->nr_validated_ptes = i + 1; >> + rc = -EAGAIN; >> + break; >> + } >> } >> >> if ( rc >= 0 && (type & PGT_pae_xen_l2) ) >