__GFP_RETRY_MAYFAILを指定

This commit is contained in:
otya
2022-12-31 11:25:24 +09:00
parent 02c9c1492a
commit 76969000f1
2 changed files with 16 additions and 3 deletions

View File

@@ -245,11 +245,19 @@ static int itedtv_usb_alloc_urb_buffers(struct itedtv_usb_context *ctx,
if (!urb->transfer_buffer) {
#ifdef __linux__
#ifdef __GFP_RETRY_MAYFAIL
if (!no_dma)
p = usb_alloc_coherent(dev, buf_size,
GFP_KERNEL, &dma);
GFP_KERNEL | __GFP_RETRY_MAYFAIL, &dma);
else
p = kmalloc(buf_size, GFP_KERNEL);
p = kmalloc(buf_size, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
#else
if (!no_dma)
p = usb_alloc_coherent(dev, buf_size,
GFP_KERNEL | __GFP_REPEAT, &dma);
else
p = kmalloc(buf_size, GFP_KERNEL | __GFP_REPEAT);
#endif
#else
p = kmalloc(buf_size, GFP_KERNEL);
#endif

View File

@@ -104,8 +104,13 @@ int ringbuffer_alloc(struct ringbuffer *ringbuf, size_t size)
ringbuffer_reset_nolock(ringbuf);
if (!ringbuf->buf) {
ringbuf->buf = (u8 *)__get_free_pages(GFP_KERNEL,
#ifdef __GFP_RETRY_MAYFAIL
ringbuf->buf = (u8 *)__get_free_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL,
get_order(size));
#else
ringbuf->buf = (u8 *)__get_free_pages(GFP_KERNEL | __GFP_REPEAT,
get_order(size));
#endif
if (!ringbuf->buf)
ret = -ENOMEM;
else