Skip to contentSkip to conversation

swiotlb

DISCUSSION Ky Srinivasan 3 participants 5 messages Apr 13, 2006 – Apr 14, 2006

lore
Share & tools
lore
#0 lore raw

Given that the function __sync_single() can be called in an interrupt
context, why do we call a potentially blocking function
(__copy_to_user) from within this function?

Regards,

K. Y

#1 lore raw

Ky,
You are correct. I received this as a bugzilla on FC-5. Testing a solution now (replacing copy_to_user w/copy_to_user_inatomic).
The other problem with the call to copy_to_user is that a kmap_atomic() is done just before it as well, and the thread can't be blocked before the kunmap_atomic() is invoked (after the copy_to_user()).

Unfortunately, tomorrow is company holiday, so I won't complete the testing until Monday; need to get more memory to force swiotlb's sync_single() to do the copy (due to bounce IO).

- Don

Quoted 13 lines · Ky Srinivasan

Given that the function __sync_single() can be called in an interrupt
context, why do we call a potentially blocking function
(__copy_to_user) from within this function?

Regards,

K. Y

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
In reply to Ky Srinivasan
Quoted 3 lines · Ky Srinivasan

Given that the function __sync_single() can be called in an interrupt
context, why do we call a potentially blocking function
(__copy_to_user) from within this function?

Good point. Would __copy_to_user_inatomic() be safe? It avoids might_sleep(). We know that the page fault itself (if any) will not block on I/O -- we only use __copy_to_user() to safely catch the fault and return.

-- Keir

#2 lore raw
In reply to Don Dutile

Thanks Don. I am seeing this problem on SLES10 as well. I will wait for your fix.

K. Y

Quoted 1 line
Quoted 1 line
Quoted 1 line

Don Dutile <[email protected]> 04/13/06 9:51 pm >>>

Ky,
You are correct. I received this as a bugzilla on FC- 5. Testing a solution now (replacing copy_to_user w/copy_to_user_inatomic). The other problem with the call to copy_to_user is that a kmap_atomic()

is done just before it as well, and the thread can't be blocked before

the kunmap_atomic() is invoked (after the copy_to_user()).

Unfortunately, tomorrow is company holiday, so I won't complete the testing until Monday; need to get more memory to force swiotlb's sync_single() to do the copy (due to bounce IO).

- Don

Quoted 1 line · Ky Srinivasan

Given that the function __sync_single() can be called in an

interrupt

Quoted 5 lines

context, why do we call a potentially blocking function
(__copy_to_user) from within this function?

Regards,

Quoted 7 lines

K. Y

_______________________________________________
Xen- devel mailing list
Xen- [email protected]
http://lists.xensource.com/xen- devel

_______________________________________________
Xen- devel mailing list
Xen- [email protected]
http://lists.xensource.com/xen- devel

#4 lore raw
In reply to Keir Fraser

That should do the trick.

K. Y

Quoted 1 line
Quoted 1 line
Quoted 1 line

Keir Fraser <[email protected]> 04/14/06 2:50 am >>>

Quoted 1 line · Ky Srinivasan

Given that the function __sync_single() can be called in an

interrupt

Quoted 2 lines

context, why do we call a potentially blocking function
(__copy_to_user) from within this function?

Good point. Would __copy_to_user_inatomic() be safe? It avoids might_sleep(). We know that the page fault itself (if any) will not block on I/O -- we only use __copy_to_user() to safely catch the fault

and return.

-- Keir

_______________________________________________
Xen- devel mailing list
Xen- [email protected]
http://lists.xensource.com/xen- devel