linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* kmap_atomic and preemption
@ 2016-05-04 10:37 Vineet Gupta
  2016-05-04 13:47 ` Peter Zijlstra
  0 siblings, 1 reply; 9+ messages in thread
From: Vineet Gupta @ 2016-05-04 10:37 UTC (permalink / raw)
  To: Peter Zijlstra, Nicolas Pitre, Andrew Morton, David Hildenbrand,
	Thomas Petazzoni, Russell King
  Cc: lkml, linux-mm@kvack.org, linux-arch@vger.kernel.org

Hi,

I was staring at some recent ARC highmem crashes and see that kmap_atomic()
disables preemption even when page is in lowmem and call returns right away.
This seems to be true for other arches as well.

arch/arc/mm/highmem.c:

void *kmap_atomic(struct page *page)
{
	int idx, cpu_idx;
	unsigned long vaddr;

	preempt_disable();
	pagefault_disable();
	if (!PageHighMem(page))
		return page_address(page);

        /* do the highmem foo ... */
..
}

I would really like to implement a inline fastpath for !PageHighMem(page) case and
do the highmem foo out-of-line.

Is preemption disabling a requirement of kmap_atomic() callers independent of
where page is or is it only needed when page is in highmem and can trigger page
faults or TLB Misses between kmap_atomic() and kunmap_atomic and wants protection
against reschedules etc.

-Vineet

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-05 12:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 10:37 kmap_atomic and preemption Vineet Gupta
2016-05-04 13:47 ` Peter Zijlstra
2016-05-04 13:53   ` Thomas Petazzoni
2016-05-04 14:01     ` Vineet Gupta
2016-05-04 14:16   ` Vineet Gupta
2016-05-04 15:01     ` Peter Zijlstra
2016-05-05 12:37       ` Vineet Gupta
2016-05-04 19:17   ` Russell King - ARM Linux
2016-05-05  9:37     ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).