[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9ef4fa6-99a4-46fd-8623-b8979556566e@flourine.local>
Date: Mon, 8 Sep 2025 09:36:34 +0200
From: Daniel Wagner <dwagner@...e.de>
To: linux-nvme@...ts.infradead.org
Cc: Jens Axboe <axboe@...nel.dk>, Keith Busch <kbusch@...nel.org>,
Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
"Michael S. Tsirkin" <mst@...hat.com>, Aaron Tomlin <atomlin@...mlin.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>, Thomas Gleixner <tglx@...utronix.de>,
Costa Shulyupin <costa.shul@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
Valentin Schneider <vschneid@...hat.com>, Waiman Long <llong@...hat.com>, Ming Lei <ming.lei@...hat.com>,
Frederic Weisbecker <frederic@...nel.org>, Mel Gorman <mgorman@...e.de>, Hannes Reinecke <hare@...e.de>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
megaraidlinux.pdl@...adcom.com, linux-scsi@...r.kernel.org, storagedev@...rochip.com,
virtualization@...ts.linux.dev, GR-QLogic-Storage-Upstream@...vell.com
Subject: Re: [PATCH v8 10/12] blk-mq: use hk cpus only when isolcpus=io_queue
is enabled
On Fri, Sep 05, 2025 at 04:59:56PM +0200, Daniel Wagner wrote:
> void blk_mq_map_queues(struct blk_mq_queue_map *qmap)
> {
> - const struct cpumask *masks;
> + struct cpumask *masks __free(kfree) = NULL;
> + const struct cpumask *constraint;
> unsigned int queue, cpu, nr_masks;
> + cpumask_var_t active_hctx;
>
> + if (!zalloc_cpumask_var(&active_hctx, GFP_KERNEL))
> + goto fallback;
> +
> + free_cpumask_var(active_hctx);
> +
> + return;
> +
> +free_fallback:
> + free_cpumask_var(active_hctx);
> +
> +fallback:
> + blk_mq_map_fallback(qmap);
I am not so happy that the cpumask_var_t and __free doesn't work to
together at this point due to the 'evil way' how cpumask_var_t is defined:
ifdef CONFIG_CPUMASK_OFFSTACK
typedef struct cpumask *cpumask_var_t;
#else
typedef struct cpumask cpumask_var_t[1];
#endif /* CONFIG_CPUMASK_OFFSTACK */
In the previous version I used
cpumask_var_t active_hctx __free(free_cpumask_var) = NULL;
which resulted in a way cleaner code. Though the kernel test robot
complained with
>> block/blk-mq-cpumap.c:155:16: error: array initializer must be an initializer list
155 | cpumask_var_t active_hctx __free(free_cpumask_var) = NULL;
I try to figure out if it's possible to get this somehow working with
some witchcraft (aka pre compiler magic).
Powered by blists - more mailing lists