From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F18E9390229 for ; Mon, 16 Mar 2026 10:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773658477; cv=none; b=Pj6WP2DFk8tCd5XIubSGRb7TtrVwKlnwpb7rvXG3bHj3bpBuvEynIWVWUu53ASgR3XjNi6KU4/bIkSELO+ZCmgz1P6tB6bFpFsLxOr0+b9z/Ud5ZGOsmN/3emiqOFf3Gh7+02Lx0gHyQeVKLPMRHWzpK1acsvm1VTqfUAYneEpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773658477; c=relaxed/simple; bh=ZSI57h88KBCxyATmpw8R75Wzmeb6Dt8kMCMihmwiOJ0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=UJafqq86MbKleX+JP/jCsHgGgglXgJ3vUPgQ8hS53+xuRqGQRP9zDR05zq3qyaf+H7XyjXbZVD1g8i2l5nlXZbnBZUHFg3z+ab4Xnlhn9XVTQVNkdcR+gpkCMg7uenHsvFbXFxa1heSAaDSHCJl0NFRgLEgpu/0Isbl86pSdQnM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UUm7EkC0; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UUm7EkC0" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-43b3da235dbso1300696f8f.1 for ; Mon, 16 Mar 2026 03:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773658474; x=1774263274; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=q/+9kuHNGmF6mJHiC+r6rqWEh7NXnQhAjyYAhKBwFD4=; b=UUm7EkC0smY8AI6r0gFfAX3dmR+zfBU0h/70NgfUHYanSmk3KUYOiCNI60MYsgT5N1 OYKV9x9EqzxevWisNyZpzi6fMj6/0GaPtDE/roOK9xtAT0L28rMQSE+Co5GgoVdMIPLS kLK4bMaeGTMtifXjF/4n/Z+PPNQhr2Utey5IlPuBrFSQvnggXDsablp3N2O/vnhyHr8H ls8k/8fJn7S/qSr2ktBr7022G+X4oWlS4thYXxpftnjWrZOQYpast3yt/cKpH9nW4N2X xJHXnNqLwvRLUNqJUJu5BgAhjyDU3NiHN7VeK1B0gEM173eb7ULNWbEX/Dt/SNR8S5r6 Bp9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773658474; x=1774263274; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q/+9kuHNGmF6mJHiC+r6rqWEh7NXnQhAjyYAhKBwFD4=; b=mGM46VkuNp4iV5zOtG4PFcf8mWtl6bkA1cTyhHaog9e9LWkxDjMzfhqH966za9bzRC rDPXkYO6yL9ISxAE7RN4zjChpT0O6BEO8KlGb2exP3qc7H+2ErOAz31In/bzvQP4zOzE VO56/ymD3xjluM/0of3xbN7Fcfwt04bf1cATbOfhXT5Gnj06WBSZkcEf24kdNiu5uAsk +LUxE/aG11SZbC4NYBdGytYT4wCW56vXbqj0eIyBRGzU0bP68qh7Cgp+hnUs8KcogQl6 PmNTTEMpei6+4U4t1LxAR4unyNsKCovnU6sC1WBM+3dV9z7GHoNmIAzOn3a6DYIzk7fE F8Bw== X-Forwarded-Encrypted: i=1; AJvYcCVxAC7jCgg9XPmXXiaVYl1mGl0B3WF4r1wEJOkTfAesdO5ew4Q0aQddFe94q/MusgnuDmW4GY2vTtuvt1g=@vger.kernel.org X-Gm-Message-State: AOJu0YwzBAzgBwhOJsY6O8tchv2GTQi/XougM8YlKfYg3Nsdq/OV8vGK bLz5thevzRxWQFNwTD0OCsDRG/GNkz5SgF/1v6Ynk/yioYowMPkQse4zKIHlRx/qa0GMFyvMUFb iImRzjjSSAYhIUTSkqQ== X-Received: from wrbee14.prod.google.com ([2002:a05:6000:210e:b0:43a:397:db8a]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:adf:fd4f:0:b0:43b:3bed:154b with SMTP id ffacd0b85a97d-43b3bed1827mr7373388f8f.40.1773658473980; Mon, 16 Mar 2026 03:54:33 -0700 (PDT) Date: Mon, 16 Mar 2026 10:54:32 +0000 In-Reply-To: <20260216-rnull-v6-19-rc5-send-v1-22-de9a7af4b469@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260216-rnull-v6-19-rc5-send-v1-0-de9a7af4b469@kernel.org> <20260216-rnull-v6-19-rc5-send-v1-22-de9a7af4b469@kernel.org> Message-ID: Subject: Re: [PATCH 22/79] block: rnull: add no_sched module parameter and configfs attribute From: Alice Ryhl To: Andreas Hindborg Cc: Boqun Feng , Jens Axboe , Miguel Ojeda , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Trevor Gross , Danilo Krummrich , FUJITA Tomonori , Frederic Weisbecker , Lyude Paul , Thomas Gleixner , Anna-Maria Behnsen , John Stultz , Stephen Boyd , Lorenzo Stoakes , "Liam R. Howlett" , linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="utf-8" On Mon, Feb 16, 2026 at 12:35:09AM +0100, Andreas Hindborg wrote: > Add support for disabling the default IO scheduler by adding: > - no_sched module parameter to control scheduler selection at device > creation. > - no_sched configfs attribute (ID 11) for runtime configuration. > - Use of NO_DEFAULT_SCHEDULER flag when no_sched is enabled. > > This allows bypassing the default 'mq-deadline' scheduler and using 'none' > instead, which can improve performance for certain workloads. The flag > selection logic is updated to use compound assignment operators for better > readability. > > Signed-off-by: Andreas Hindborg > +#[vtable] > +impl configfs::AttributeOperations<11> for DeviceConfig { > + type Data = DeviceConfig; > + > + fn show(this: &DeviceConfig, page: &mut [u8; PAGE_SIZE]) -> Result { > + let mut writer = kernel::str::Formatter::new(page); > + > + if this.data.lock().no_sched { > + writer.write_str("1\n")?; > + } else { > + writer.write_str("0\n")?; > + } > + > + Ok(writer.bytes_written()) > + } > + > + fn store(this: &DeviceConfig, page: &[u8]) -> Result { > + if this.data.lock().powered { > + return Err(EBUSY); > + } > + > + this.data.lock().no_sched = kstrtobool_bytes(page)?; > + > + Ok(()) > + } Not using your fancy macro. Also, TOCTOU. Alice