All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM
@ 2021-02-09  8:10 Jeffle Xu
  2021-02-09  8:32 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffle Xu @ 2021-02-09  8:10 UTC (permalink / raw
  To: davem; +Cc: linux-ide, joseph.qi, Jeffle Xu

While the whole block layer has migrated to mq framework,
QUEUE_FLAG_ADD_RANDOM is not included in QUEUE_FLAG_MQ_DEFAULT as the
default flags.

Keep 'blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, ...)' there as the
statement is self explanatory. Besides it can make the code stronger
to keep a complete if-clear-else-set statement, no matter how
QUEUE_FLAG_MQ_DEFAULT could be refactored.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
 drivers/ide/ide-disk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 34b9441084f8..7f19af48a6e7 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -688,6 +688,9 @@ static void ide_disk_setup(ide_drive_t *drive)
 	if (ata_id_is_ssd(id)) {
 		blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
 		blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
+	} else {
+		blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
+		blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
 	}
 
 	/* calculate drive capacity, and select LBA if possible */
-- 
2.27.0


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

* Re: [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM
  2021-02-09  8:10 [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM Jeffle Xu
@ 2021-02-09  8:32 ` Christoph Hellwig
  2021-02-09  9:00   ` JeffleXu
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2021-02-09  8:32 UTC (permalink / raw
  To: Jeffle Xu; +Cc: davem, linux-ide, joseph.qi

On Tue, Feb 09, 2021 at 04:10:13PM +0800, Jeffle Xu wrote:
> While the whole block layer has migrated to mq framework,
> QUEUE_FLAG_ADD_RANDOM is not included in QUEUE_FLAG_MQ_DEFAULT as the
> default flags.

If you are using the legacy ide code anywhere please switch to libata
ASAP as it is about to go away.

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

* Re: [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM
  2021-02-09  8:32 ` Christoph Hellwig
@ 2021-02-09  9:00   ` JeffleXu
  0 siblings, 0 replies; 3+ messages in thread
From: JeffleXu @ 2021-02-09  9:00 UTC (permalink / raw
  To: Christoph Hellwig; +Cc: davem, linux-ide, joseph.qi



On 2/9/21 4:32 PM, Christoph Hellwig wrote:
> On Tue, Feb 09, 2021 at 04:10:13PM +0800, Jeffle Xu wrote:
>> While the whole block layer has migrated to mq framework,
>> QUEUE_FLAG_ADD_RANDOM is not included in QUEUE_FLAG_MQ_DEFAULT as the
>> default flags.
> 
> If you are using the legacy ide code anywhere please switch to libata
> ASAP as it is about to go away.
> 

Thanks for replying. I have not encountered any trouble in reality
world. Actually I just find that this code can't work well when I'm
search QUEUE_FLAG_ADD_RANDOM. I'm not familiar with ide world. Please
let me know if I miss something.

Also there are several device drivers still calling
'blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q)', though they have
migrated to mq and have no need clearing QUEUE_FLAG_ADD_RANDOM.

-- 
Thanks,
Jeffle

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

end of thread, other threads:[~2021-02-09  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-09  8:10 [PATCH] ide: set missing QUEUE_FLAG_ADD_RANDOM Jeffle Xu
2021-02-09  8:32 ` Christoph Hellwig
2021-02-09  9:00   ` JeffleXu

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.