Re: [PATCH 3/3] v9fs: zero copy implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Latchesar Ionkov <[email protected]> wrote:
>
> Performance enhancement reducing the number of copies in the data and
> stat paths.
> 
> ...
> diff --git a/fs/9p/mux.c b/fs/9p/mux.c
> index 884fa75..e58c6ed 100644
> --- a/fs/9p/mux.c
> +++ b/fs/9p/mux.c
> @@ -35,8 +35,8 @@
>  #include "debug.h"
>  #include "v9fs.h"
>  #include "9p.h"
> -#include "transport.h"
>  #include "conv.h"
> +#include "transport.h"
>  #include "mux.h"
>  
>  #define NELEM(x) (sizeof(x) / sizeof((x)[0]))
> @@ -76,6 +76,7 @@ struct v9fs_mux_data {
>  	wait_queue_head_t equeue;
>  	struct list_head req_list;
>  	struct list_head unsent_req_list;
> +	struct v9fs_fcall *rcall;
>  	int rpos;
>  	char *rbuf;
>  	int wpos;
> @@ -103,11 +104,15 @@ struct v9fs_mux_rpc {
>  	wait_queue_head_t wqueue;
>  };
>  
> +extern int v9fs_errstr2errno(char *str, int len);
> +

Please don't put extern declarations in .c files.  This declaraton is
already in error.h so I suspect it can just be axed.

>  static int v9fs_poll_proc(void *);
>  static void v9fs_read_work(void *);
>  static void v9fs_write_work(void *);
>  static void v9fs_pollwait(struct file *filp, wait_queue_head_t * wait_address,
>  			  poll_table * p);
> +static u16 v9fs_mux_get_tag(struct v9fs_mux_data *);
> +static void v9fs_mux_put_tag(struct v9fs_mux_data *, u16);
>  
>  static DECLARE_MUTEX(v9fs_mux_task_lock);
>  static struct workqueue_struct *v9fs_mux_wq;
> @@ -168,8 +173,9 @@ static void v9fs_mux_poll_start(struct v
>  			if (v9fs_mux_poll_tasks[i].task == NULL) {
>  				vpt = &v9fs_mux_poll_tasks[i];
>  				dprintk(DEBUG_MUX, "create proc %p\n", vpt);
> -				vpt->task = kthread_create(v9fs_poll_proc, 
> -					vpt, "v9fs-poll");
> +				vpt->task =
> +				    kthread_create(v9fs_poll_proc, vpt,
> +						   "v9fs-poll");

What happens if kthread_create() fails?

>  	dprintk(DEBUG_VFS, " \n");
>  
> -	v9ses = kcalloc(1, sizeof(struct v9fs_session_info), GFP_KERNEL);
> +	v9ses = kmalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
>  	if (!v9ses)
>  		return ERR_PTR(-ENOMEM);
>  
> +	memset(v9ses, 0, sizeof(struct v9fs_session_info));

We have nice kzalloc() which does this.  (If/when this is changed, please
convert all of v9fs in one patch).


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux