lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Mar 2009 22:01:11 -0700
From:	Jeremy Fitzhardinge <>
To:	Avi Kivity <>
CC:	Nick Piggin <>,
	Linux Kernel Mailing List <>,
	Linux Memory Management List <>,
	the arch/x86 maintainers <>
Subject: Re: [PATCH 1/2] x86/mm: maintain a percpu "in get_user_pages_fast"

Avi Kivity wrote:
> Jeremy Fitzhardinge wrote:
>> get_user_pages_fast() relies on cross-cpu tlb flushes being a barrier
>> between clearing and setting a pte, and before freeing a pagetable page.
>> It usually does this by disabling interrupts to hold off IPIs, but
>> some tlb flush implementations don't use IPIs for tlb flushes, and
>> must use another mechanism.
>> In this change, add in_gup_cpumask, which is a cpumask of cpus currently
>> performing a get_user_pages_fast traversal of a pagetable.  A cross-cpu
>> tlb flush function can use this to determine whether it should hold-off
>> on the flush until the gup_fast has finished.
>> @@ -255,6 +260,10 @@ int get_user_pages_fast(unsigned long start, int 
>> nr_pages, int write,
>>      * address down to the the page and take a ref on it.
>>      */
>>     local_irq_disable();
>> +
>> +    cpu = smp_processor_id();
>> +    cpumask_set_cpu(cpu, in_gup_cpumask);
>> +
> This will bounce a cacheline, every time.  Please wrap in CONFIG_XEN 
> and skip at runtime if Xen is not enabled.

Every time?  Only when running successive gup_fasts on different cpus, 
and only twice per gup_fast. (What's the typical page count?  I see that 
kvm and lguest are page-at-a-time users, but presumably direct IO has 
larger batches.)

Alternatively, it could have per-cpu flags and the other side could 
construct the mask (I originally had that, but this was simpler).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists