From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Date: Fri, 19 Oct 2018 11:26:37 +0200 From: Oleksandr Natalenko To: Linus Walleij Cc: linux-block , Jens Axboe , linux-mmc , linux-mtd@lists.infradead.org, Pavel Machek , Paolo Valente , Ulf Hansson , Richard Weinberger , Adrian Hunter , Bart Van Assche , Jan Kara , Artem Bityutskiy , Christoph Hellwig , One Thousand Gnomes , Mark Brown , Damien Le Moal , Johannes Thumshirn , Jonathan Corbet Subject: Re: [PATCH v2] block: BFQ default for single queue devices In-Reply-To: References: <20181015141059.26579-1-linus.walleij@linaro.org> <18744e21b9f5aa4b3ab721a007a3e9a2@natalenko.name> Message-ID: <42fc6a366e88335b72517ea7d58847fd@natalenko.name> List-ID: Hi. On 19.10.2018 10:33, Linus Walleij wrote: >> > + /* >> > + * Zoned devices must use a deadline scheduler because currently >> > + * that is the only scheduler respecting zoned writes. >> > + */ >> > + if (blk_queue_is_zoned(q)) >> > + policy = "mq-deadline"; >> > + else if (IS_ENABLED(CONFIG_IOSCHED_BFQ)) >> > + policy = "bfq"; >> > + else >> > + policy = "mq-deadline"; >> >> If more rules will be needed in the future, shall we just add extra >> ifs, >> or it would be better to craft some struct/table now + policy search >> helper? > > Let's do it when it happens. Premature optimization is the root > of all evil ;) I'd say, this is a matter of code readability, not optimisations. I do not strongly object against current approach, though. -- Oleksandr Natalenko (post-factum)