[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

CAS (lws_compare_and_swap32)



I am currently investigating FTBFS of gauche (a scheme interpreter) on
hppa.  My knowledge of hppa is quite limited, though.  I am not on
this list.  Please send Cc: to me.

I have a question of CAS implementation.  I assume uni processor
system.

I am looking at:
	linux-source-2.6.30/arch/parisc/kernel/syscall.S

----------------
	/*
		prev = *addr;
		if ( prev == old )
		  *addr = new;
		return prev;
	*/
[...]
cas_action:
[...]
	/* The load and store could fail */
1:	ldw	0(%sr3,%r26), %r28
	sub,<>	%r28, %r25, %r0
2:	stw	%r24, 0(%sr3,%r26)
----------------

Suppose that <addr> points to copy-on-write memory.  At the label 2,
storing data to <addr> will invoke memory trap and it will go to
do_page_fault() to get new memory.  In this scenario, is there a
possibility for the process to be scheduled off?

Call chain in question is:
	do_page_fault()
	  ->..-> do_wp_page()
	    ->..-> __alloc_pages_internal() with GFP_HIGHUSER_MOVABLE
	      ->..> schedule()

linux/gfp.h has the definition:
#define GFP_HIGHUSER_MOVABLE	(__GFP_WAIT | __GFP_IO | __GFP_FS | \
				 __GFP_HARDWALL | __GFP_HIGHMEM | \
				 __GFP_MOVABLE)
-- 


Reply to: