> > The usb-storage code could retry when it gets "-ENOMEM" > > when submitting an URB, to get similar effects, yes? > > Thinking about it again, trying to be perfect in face of OOM > is a little silly. > Instead of retrying could we simply use a flag in the urb that means > retry memory allocations with GFP_ATOMIC if they fail ? > This way we are reasonably good and keep the API clean.
It'd get really nasty to modify all the HCDs to retry on -ENOMEM. And any retries would make no sense if the urb submission was under GFP_ATOMIC ... since that precludes the "block till something is (or might be) freed" logic a retry would rely on. So I still think it's easier to package that as specific to usb-storage. Just a wrapper around usb_submit_urb(), retry N times if -ENOMEM. (But it's still a good idea to move memory allocations off the critical path ... fewer failure modes "by design" is always a good thing, just like shorter/faster common paths.) - Dave _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel