From nobody Sun Dec 14 21:14:56 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 A971F21D597 for ; Fri, 20 Dec 2024 15:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734709732; cv=none; b=QIChTy+Icp4UB1XK/50QrmEW1iMJgx1yshG1sHyK76SxXcfcWLKunW0POAltzVPteuDBjVAg8Ka3mm7cp1D9uEV3aVX9ubi5KanZ6N5NsMCvfNPssRCAHIZ1GS/JbR97YqvdPhLJ1opHdHJNyFbDCbAiALHq9DyDKeCjtbvv7E0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734709732; c=relaxed/simple; bh=zE0xjm5rhzd2cUhrSxtogiQia/migrwaLvBNVMhxtxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZyY0YIZgq04nRsDSrkK2XWbAJ+Hskb18qNWLulJw01bxUPgZ99Wb0KjAHbc0w70gm62itnLZIEEUO3oNqOLGfy/+hmrcgJwTRpC+/HblUaPleorS/uUqVJBQedhbubLxr6Yrq6+MnGUgiWoS4alfgoJ43Hp9pQ3F2u4fMNTIN3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=XpNPsYgT; arc=none smtp.client-ip=209.85.166.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="XpNPsYgT" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-844e61f3902so168720439f.0 for ; Fri, 20 Dec 2024 07:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1734709730; x=1735314530; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ol/7y93UZDywrWGNYi5AP2kj1AIRWUpJ2p+2aggyqzo=; b=XpNPsYgTpipkSpVs7LrbeF1UL0my+iixYP3Cr4OQkBjATc8tdVJhLIT476q7wihOZV BkB5ehPy16t6rAFUTluHuYjes5Gaf51+jjOZiXYKMf6qtE5GjeUIijoOA/ODjm8NdrLn 0XZ8WETcvLRc+t5zb707wNiMIptKwv6c0v2+0NfazgNqK9co/x4RAnB4QT+wpvvb6GmZ 5Xmm3bZIPMrEsJLXaN8u6rDnXrVegjcLy1lcYFDlE0OsZzbhB7rYdv49n1kpQ6M7o3D6 I9fNEVK3Mz1L9I6osQSY4N8BMInx4CeTCYQySqVBUI3Ntk5Ho718230kzdmgVMGjbNjS JvhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734709730; x=1735314530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ol/7y93UZDywrWGNYi5AP2kj1AIRWUpJ2p+2aggyqzo=; b=dckDSzaV2Epw5VSQ4GAlGadELW1zBYSrzD+SvVBx9YgQTOvEx6rXzkoPS1NlaV9K26 VFjxB0Rn/W2twOkfUEOdUTBdzmHds+NrN/9Q9fmtT8d13U/6ETon8deAuIAvhZG2UjJn tiQYpOYCIuodGLf4w7y5tnBRwZhS8gZmDdfcdP+Ayp5TYI80KLq/Bqdd1MYPY4dldnn1 JzPPE9fU8f3H7hND7gl4BEcQxmHiTRlSmTke+r6mMdxrWsOlllRX5uoRg9OP+7prX+bS 8nYmh3BhkZOp9NAq75kgPceSWL7QoyJXPdp9EQHP0BBWZXDQMddS/2R+b6hZCBqmooEt yPKQ== X-Forwarded-Encrypted: i=1; AJvYcCW+35bndcss4mWrt7E9Zn0R/ikZTiwhRe7wvsuc4aq/OIpgjF/bsg805nBjVz72dftMrUvkz3wOPaE0nnk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo1vyHlUO5p7v5MX84Ne8/Q8fcTLZEIuiFm2oTxHahDWEvuCbl jW9fbY0Z0+p3eAjJpF27ym3sq8zK2r8idi3nuXO6ENGqZSeQsV4RHeC2Mxul69lHh9VGDJR702p c X-Gm-Gg: ASbGncuZe0Zp6CnK1knh+7tu5t9ySRO9IR+uQLV2UroFpXXYlPmLCqAyVJ0P7jTQt5/ DUeVTZAZsHTgC5D/cBRq+t3P5WQhH+nRmUNuF5IsxZ/WiwfsJXXOs5nYWDxHUmCuuZDuvD5CDiI QzWPtMN9TSFniwL58PogewLjFgp+W71qTfX13MPn/A1XkctNruzv7LAgi9sCD6PeyuEzSUu7nn1 HefDsiN3Lu29kKaZixotI4k+cGZw/5+WJ19AOqBcGrMSdCkQfW7AUMQ93R0 X-Google-Smtp-Source: AGHT+IHBkJtXw0hIyGWIXWPfQ49T4FfZrn/htFVCpySmbejAxdhZ6x6C0BhRXfs8Jh6Ol55mQ+pxBw== X-Received: by 2002:a05:6e02:17cf:b0:3a7:70a4:6872 with SMTP id e9e14a558f8ab-3c2d257934dmr36428035ab.9.1734709729627; Fri, 20 Dec 2024 07:48:49 -0800 (PST) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e68bf66ed9sm837821173.45.2024.12.20.07.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 07:48:48 -0800 (PST) From: Jens Axboe To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, willy@infradead.org, kirill@shutemov.name, bfoster@redhat.com, Jens Axboe Subject: [PATCH 11/12] mm: call filemap_fdatawrite_range_kick() after IOCB_DONTCACHE issue Date: Fri, 20 Dec 2024 08:47:49 -0700 Message-ID: <20241220154831.1086649-12-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220154831.1086649-1-axboe@kernel.dk> References: <20241220154831.1086649-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a buffered write submitted with IOCB_DONTCACHE has been successfully submitted, call filemap_fdatawrite_range_kick() to kick off the IO. File systems call generic_write_sync() for any successful buffered write submission, hence add the logic here rather than needing to modify the file system. Signed-off-by: Jens Axboe --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 653b5efa3d3f..58a618853574 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2912,6 +2912,11 @@ static inline ssize_t generic_write_sync(struct kioc= b *iocb, ssize_t count) (iocb->ki_flags & IOCB_SYNC) ? 0 : 1); if (ret) return ret; + } else if (iocb->ki_flags & IOCB_DONTCACHE) { + struct address_space *mapping =3D iocb->ki_filp->f_mapping; + + filemap_fdatawrite_range_kick(mapping, iocb->ki_pos, + iocb->ki_pos + count); } =20 return count; --=20 2.45.2