All of lore.kernel.org
 help / color / mirror / Atom feed
* Ceph patches for the merge window?
@ 2023-06-27 10:59 David Howells
  2023-06-27 12:52 ` Ilya Dryomov
  2023-06-27 14:27 ` David Howells
  0 siblings, 2 replies; 4+ messages in thread
From: David Howells @ 2023-06-27 10:59 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: dhowells, Xiubo Li, Jeff Layton, ceph-devel

Hi Ilya,

Is there a branch somewhere that are the ceph patches for this merge window?

David


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

* Re: Ceph patches for the merge window?
  2023-06-27 10:59 Ceph patches for the merge window? David Howells
@ 2023-06-27 12:52 ` Ilya Dryomov
  2023-06-27 14:27 ` David Howells
  1 sibling, 0 replies; 4+ messages in thread
From: Ilya Dryomov @ 2023-06-27 12:52 UTC (permalink / raw)
  To: David Howells; +Cc: Xiubo Li, Jeff Layton, ceph-devel

On Tue, Jun 27, 2023 at 12:59 PM David Howells <dhowells@redhat.com> wrote:
>
> Hi Ilya,
>
> Is there a branch somewhere that are the ceph patches for this merge window?

Hi David,

Not quite yet but ceph-client/master [1] should be very close now.

[1] https://github.com/ceph/ceph-client/commits/master

Thanks,

                Ilya

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

* Re: Ceph patches for the merge window?
  2023-06-27 10:59 Ceph patches for the merge window? David Howells
  2023-06-27 12:52 ` Ilya Dryomov
@ 2023-06-27 14:27 ` David Howells
  2023-06-27 16:44   ` Ilya Dryomov
  1 sibling, 1 reply; 4+ messages in thread
From: David Howells @ 2023-06-27 14:27 UTC (permalink / raw)
  Cc: dhowells, Ilya Dryomov, Xiubo Li, Jeff Layton, ceph-devel

Looking at "ceph: add a dedicated private data for netfs rreq" you might find
the attached patch useful.  It's in my list of netfs patches to push once I
get away from splice.

David
---
netfs: Allow the netfs to make the io (sub)request alloc larger

Allow the network filesystem to specify extra space to be allocated on the
end of the io (sub)request.  This allows cifs, for example, to use this
space rather than allocating its own cifs_readdata struct.

Signed-off-by: David Howells <dhowells@redhat.com>
---
 fs/netfs/objects.c    |    7 +++++--
 include/linux/netfs.h |    2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c
index e41f9fc9bdd2..2f1865ff7cce 100644
--- a/fs/netfs/objects.c
+++ b/fs/netfs/objects.c
@@ -22,7 +22,8 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping,
 	struct netfs_io_request *rreq;
 	int ret;
 
-	rreq = kzalloc(sizeof(struct netfs_io_request), GFP_KERNEL);
+	rreq = kzalloc(ctx->ops->io_request_size ?: sizeof(struct netfs_io_request),
+		       GFP_KERNEL);
 	if (!rreq)
 		return ERR_PTR(-ENOMEM);
 
@@ -116,7 +117,9 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq
 {
 	struct netfs_io_subrequest *subreq;
 
-	subreq = kzalloc(sizeof(struct netfs_io_subrequest), GFP_KERNEL);
+	subreq = kzalloc(rreq->netfs_ops->io_subrequest_size ?:
+			 sizeof(struct netfs_io_subrequest),
+			 GFP_KERNEL);
 	if (subreq) {
 		INIT_LIST_HEAD(&subreq->rreq_link);
 		refcount_set(&subreq->ref, 2);
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index b76a1548d311..442b88e39945 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -214,6 +214,8 @@ struct netfs_io_request {
  * Operations the network filesystem can/must provide to the helpers.
  */
 struct netfs_request_ops {
+	unsigned int	io_request_size;	/* Alloc size for netfs_io_request struct */
+	unsigned int	io_subrequest_size;	/* Alloc size for netfs_io_subrequest struct */
 	int (*init_request)(struct netfs_io_request *rreq, struct file *file);
 	void (*free_request)(struct netfs_io_request *rreq);
 	int (*begin_cache_operation)(struct netfs_io_request *rreq);


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

* Re: Ceph patches for the merge window?
  2023-06-27 14:27 ` David Howells
@ 2023-06-27 16:44   ` Ilya Dryomov
  0 siblings, 0 replies; 4+ messages in thread
From: Ilya Dryomov @ 2023-06-27 16:44 UTC (permalink / raw)
  To: David Howells; +Cc: Xiubo Li, Jeff Layton, ceph-devel

On Tue, Jun 27, 2023 at 4:28 PM David Howells <dhowells@redhat.com> wrote:
>
> Looking at "ceph: add a dedicated private data for netfs rreq" you might find
> the attached patch useful.  It's in my list of netfs patches to push once I
> get away from splice.
>
> David
> ---
> netfs: Allow the netfs to make the io (sub)request alloc larger
>
> Allow the network filesystem to specify extra space to be allocated on the
> end of the io (sub)request.  This allows cifs, for example, to use this
> space rather than allocating its own cifs_readdata struct.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>  fs/netfs/objects.c    |    7 +++++--
>  include/linux/netfs.h |    2 ++
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c
> index e41f9fc9bdd2..2f1865ff7cce 100644
> --- a/fs/netfs/objects.c
> +++ b/fs/netfs/objects.c
> @@ -22,7 +22,8 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping,
>         struct netfs_io_request *rreq;
>         int ret;
>
> -       rreq = kzalloc(sizeof(struct netfs_io_request), GFP_KERNEL);
> +       rreq = kzalloc(ctx->ops->io_request_size ?: sizeof(struct netfs_io_request),
> +                      GFP_KERNEL);
>         if (!rreq)
>                 return ERR_PTR(-ENOMEM);
>
> @@ -116,7 +117,9 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq
>  {
>         struct netfs_io_subrequest *subreq;
>
> -       subreq = kzalloc(sizeof(struct netfs_io_subrequest), GFP_KERNEL);
> +       subreq = kzalloc(rreq->netfs_ops->io_subrequest_size ?:
> +                        sizeof(struct netfs_io_subrequest),
> +                        GFP_KERNEL);
>         if (subreq) {
>                 INIT_LIST_HEAD(&subreq->rreq_link);
>                 refcount_set(&subreq->ref, 2);
> diff --git a/include/linux/netfs.h b/include/linux/netfs.h
> index b76a1548d311..442b88e39945 100644
> --- a/include/linux/netfs.h
> +++ b/include/linux/netfs.h
> @@ -214,6 +214,8 @@ struct netfs_io_request {
>   * Operations the network filesystem can/must provide to the helpers.
>   */
>  struct netfs_request_ops {
> +       unsigned int    io_request_size;        /* Alloc size for netfs_io_request struct */
> +       unsigned int    io_subrequest_size;     /* Alloc size for netfs_io_subrequest struct */

Yup, definitely a case for a future improvement to get rid of an extra
allocation.  I would suggest adding helpers for casting to and from the
private area for both netfs_io_request and netfs_io_subrequest to the
framework, see blk_mq_rq_to/from_pdu() for an example.

Thanks,

                Ilya

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

end of thread, other threads:[~2023-06-27 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 10:59 Ceph patches for the merge window? David Howells
2023-06-27 12:52 ` Ilya Dryomov
2023-06-27 14:27 ` David Howells
2023-06-27 16:44   ` Ilya Dryomov

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.