All of lore.kernel.org
 help / color / mirror / Atom feed
* Useless test in alloc_multiple_bios
@ 2024-05-15 18:15 Mikulas Patocka
  2024-05-16  9:19 ` Ming Lei
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2024-05-15 18:15 UTC (permalink / raw)
  To: Mike Snitzer, Ming Lei; +Cc: dm-devel

Hi

I found this piece of code in alloc_multiple_bios:
int try = (gfp_flag & GFP_NOWAIT) ? 0 : 1;

The problem is that GFP_NOWAIT includes __GFP_KSWAPD_RECLAIM and GFP_IO 
also includes __GFP_KSWAPD_RECLAIM - so the test always returns true and 
we always start with try = 0. This code was introduced by the commit 
4a2fe2960891f1ccd7805d0973284fd44c2f12b4.

I am inclined to remove this logic at all and always start with try = 0; 
- trying to allocate bios first with GFP_NOWAIT makes no harm (and it 
improves performance because we don't need to grab the lock) and if the 
allocation fails, it is retried with GFP_NOIO.

I'd like to ask - if you think that this piece of code has some purpose, 
please describe the purpose.

Mikulas


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

end of thread, other threads:[~2024-05-16  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 18:15 Useless test in alloc_multiple_bios Mikulas Patocka
2024-05-16  9:19 ` Ming Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.