public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@ns.caldera.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rik van Riel <riel@conectiva.com.br>,
	mingo@elte.hu, linux-kernel@vger.kernel.org,
	kiobuf-io-devel@lists.sourceforge.net
Subject: Re: [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1
Date: Thu, 18 Jan 2001 18:50:23 +0100	[thread overview]
Message-ID: <20010118185023.A23381@caldera.de> (raw)
In-Reply-To: <20010118015333.A20691@caldera.de> <Pine.LNX.4.10.10101171659160.10878-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.10.10101171659160.10878-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Wed, Jan 17, 2001 at 05:13:31PM -0800

On Wed, Jan 17, 2001 at 05:13:31PM -0800, Linus Torvalds wrote:
> 
> 
> On Thu, 18 Jan 2001, Christoph Hellwig wrote:
> > 
> > /*
> >  * a simple page,offset,legth tuple like Linus wants it
> >  */
> > struct kiobuf2 {
> > 	struct page *   page;   /* The page itself               */
> > 	u_int16_t       offset; /* Offset to start of valid data */
> > 	u_int16_t       length; /* Number of valid bytes of data */
> > };
> 
> Please use "u16". Or "__u16" if you want to export it to user space.

Ok.


> 
> > struct kiovec2 {
> > 	int             nbufs;          /* Kiobufs actually referenced */
> > 	int             array_len;      /* Space in the allocated lists */
> > 	struct kiobuf * bufs;
> 
> Any reason for array_len?

It's usefull for the expand function - but with kiobufs as secondary data
structure it may no more be nessesary.

> Why not just 
> 
> 	int nbufs,
> 	struct kiobuf *bufs;
> 
> 
> Remember: simplicity is a virtue. 
> 
> Simplicity is also what makes it usable for people who do NOT want to have
> huge overhead.
> 
> > 	unsigned int    locked : 1;     /* If set, pages has been locked */
> 
> Remove this. I don't think it's valid to lock the pages. Who wants to use
> this anyway?

E.g. in the block IO pathes the pages have to be locked.
It's also used by free_kiovec to see wether to do unlock_kiovec before.

> 
> > 	/* Always embed enough struct pages for 64k of IO */
> > 	struct kiobuf * buf_array[KIO_STATIC_PAGES];	 
> 
> Kill kill kill kill. 
> 
> If somebody wants to embed a kiovec into their own data structure, THEY
> can decide to add their own buffers etc. A fundamental data structure
> should _never_ make assumptions like this.

Ok.

> 
> > 	/* Private data */
> > 	void *          private;
> > 	
> > 	/* Dynamic state for IO completion: */
> > 	atomic_t        io_count;       /* IOs still in progress */
> 
> What is io_count used for?

In the current buffer_head based IO-scheme it is used to determine wether
all bh request are finished.  It's obsolete once we pass kiobufs to the
low-level drivers.

> 
> > 	int             errno;
> > 
> > 	/* Status of completed IO */
> > 	void (*end_io)	(struct kiovec *); /* Completion callback */
> > 	wait_queue_head_t wait_queue;
> 
> I suspect all of the above ("private", "end_io" etc) should be at a higher
> layer. Not everybody will necessarily need them.
> 
> Remember: if this is to be well designed, we want to have the data
> structures to pass down to low-level drivers etc, that may not want or
> need a lot of high-level stuff. You should not pass down more than the
> driver really needs.
> 
> In the end, the only thing you _know_ a driver will need (assuming that it
> wants these kinds of buffers) is just
> 
> 	int nbufs;
> 	struct biobuf *bufs;
> 
> That's kind of the minimal set. That should be one level of abstraction in
> its own right. 

Ok. Then we need an additional more or less generic object that is used for
passing in a rw_kiovec file operation (and we really want that for many kinds
of IO). I thould mostly be used for communicating to the high-level driver.

/*
 * the name is just plain stupid, but that shouldn't matter
 */
struct vfs_kiovec {
	struct kiovec *	iov;

	/* private data, mostly for the callback */
	void * private;

	/* completion callback */
 	void (*end_io)	(struct vfs_kiovec *);
 	wait_queue_head_t wait_queue;
};

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-18 17:52 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08  1:24 [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1 David S. Miller
2001-01-08 10:39 ` Christoph Hellwig
2001-01-08 10:34   ` David S. Miller
2001-01-08 18:05     ` Rik van Riel
2001-01-08 21:07       ` David S. Miller
2001-01-09 10:23       ` Ingo Molnar
2001-01-09 10:31         ` Christoph Hellwig
2001-01-09 10:31           ` David S. Miller
2001-01-09 11:28             ` Christoph Hellwig
2001-01-09 11:42               ` David S. Miller
2001-01-09 12:04               ` Ingo Molnar
2001-01-09 14:25                 ` Stephen C. Tweedie
2001-01-09 14:33                   ` Alan Cox
2001-01-09 15:00                   ` Ingo Molnar
2001-01-09 15:27                     ` Stephen C. Tweedie
2001-01-09 16:16                       ` Ingo Molnar
2001-01-09 16:37                         ` Alan Cox
2001-01-09 16:48                           ` Ingo Molnar
2001-01-09 17:29                             ` Alan Cox
2001-01-09 17:38                               ` Jens Axboe
2001-01-09 18:38                                 ` Ingo Molnar
2001-01-09 19:54                                   ` Andrea Arcangeli
2001-01-09 20:10                                     ` Ingo Molnar
2001-01-10  0:00                                       ` Andrea Arcangeli
2001-01-09 20:12                                     ` Jens Axboe
2001-01-09 23:20                                       ` Andrea Arcangeli
2001-01-09 23:34                                         ` Jens Axboe
2001-01-09 23:52                                           ` Andrea Arcangeli
2001-01-17  5:16                                     ` Rik van Riel
2001-01-09 17:56                             ` Chris Evans
2001-01-09 18:41                               ` Ingo Molnar
2001-01-09 22:58                                 ` [patch]: ac4 blk (was Re: [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1) Jens Axboe
2001-01-09 19:20                           ` [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1 J Sloan
2001-01-09 18:10                         ` Stephen C. Tweedie
2001-01-09 15:38                     ` Benjamin C.R. LaHaise
2001-01-09 16:40                       ` Ingo Molnar
2001-01-09 17:30                         ` Benjamin C.R. LaHaise
2001-01-09 18:12                           ` Stephen C. Tweedie
2001-01-09 18:35                           ` Ingo Molnar
2001-01-09 17:53                       ` Christoph Hellwig
2001-01-09 21:13                   ` David S. Miller
2001-01-09 19:14               ` Linus Torvalds
2001-01-09 20:07                 ` Ingo Molnar
2001-01-09 20:15                   ` Linus Torvalds
2001-01-09 20:36                     ` Christoph Hellwig
2001-01-09 20:55                       ` Linus Torvalds
2001-01-09 21:12                         ` Christoph Hellwig
2001-01-09 21:26                           ` Linus Torvalds
2001-01-10  7:42                             ` Christoph Hellwig
2001-01-10  8:05                               ` Linus Torvalds
2001-01-10  8:33                                 ` Christoph Hellwig
2001-01-10  8:37                                 ` Andrew Morton
2001-01-10 23:32                                   ` Linus Torvalds
2001-01-19 15:55                                     ` Andrew Scott
2001-01-17 14:05                               ` Rik van Riel
2001-01-18  0:53                                 ` Christoph Hellwig
2001-01-18  1:13                                   ` Linus Torvalds
2001-01-18 17:50                                     ` Christoph Hellwig [this message]
2001-01-18 18:04                                       ` Linus Torvalds
2001-01-18 21:12                                     ` Albert D. Cahalan
2001-01-19  1:52                                       ` 2.4.1-pre8 video/ohci1394 compile problem ebi4
2001-01-19  6:55                                       ` [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1 Linus Torvalds
2001-01-09 23:06                         ` Benjamin C.R. LaHaise
2001-01-09 23:54                           ` Linus Torvalds
2001-01-10  7:51                             ` Gerd Knorr
2001-01-12  1:42                 ` Stephen C. Tweedie
2001-01-09 11:05           ` Ingo Molnar
2001-01-09 18:27             ` Christoph Hellwig
2001-01-09 19:19               ` Ingo Molnar
2001-01-09 14:18         ` Stephen C. Tweedie
2001-01-09 14:40           ` Ingo Molnar
2001-01-09 14:51             ` Alan Cox
2001-01-09 15:17             ` Stephen C. Tweedie
2001-01-09 15:37               ` Ingo Molnar
2001-01-09 21:18               ` David S. Miller
2001-01-09 22:25               ` Linus Torvalds
2001-01-10 15:21                 ` Stephen C. Tweedie
2001-01-09 15:25             ` Stephen Frost
2001-01-09 15:40               ` Ingo Molnar
2001-01-09 15:48                 ` Stephen Frost
2001-01-10  1:14                 ` Dave Zarzycki
2001-01-10  1:14                   ` David S. Miller
2001-01-10  2:18                     ` Dave Zarzycki
2001-01-10  1:19                   ` Ingo Molnar
2001-01-10  2:56         ` storage over IP (was Re: [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1) dean gaudet
2001-01-10  2:58           ` David S. Miller
2001-01-10  3:18             ` dean gaudet
2001-01-10  3:09               ` David S. Miller
2001-01-10  3:05           ` storage over IP (was Re: [PLEASE-TESTME] Zerocopy networking patch, Alan Cox
2001-01-08 21:56 ` [PLEASE-TESTME] Zerocopy networking patch, 2.4.0-1 Jes Sorensen
2001-01-08 21:48   ` David S. Miller
2001-01-08 22:32     ` Jes Sorensen
2001-01-08 22:36       ` David S. Miller
2001-01-09 12:12         ` Ingo Molnar
2001-01-08 22:43       ` Stephen Frost
2001-01-08 22:37         ` David S. Miller
2001-01-09 13:52 ` Trond Myklebust
2001-01-09 13:42   ` David S. Miller
2001-01-09 15:27     ` Trond Myklebust
2001-01-09 21:19       ` David S. Miller
2001-01-10  9:21         ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2001-01-09 13:08 Stephen Landamore
2001-01-09 13:24 ` Ingo Molnar
2001-01-09 13:47   ` Andrew Morton
2001-01-09 19:15     ` Dan Hollis
2001-01-09 19:14   ` Dan Hollis
2001-01-09 22:03     ` David S. Miller
2001-01-09 22:58       ` Dan Hollis
2001-01-09 22:59         ` Ingo Molnar
2001-01-09 23:11           ` Dan Hollis
2001-01-10  3:24           ` Chris Wedgwood
2001-01-09 17:46 Manfred Spraul
2001-01-10  8:41 Manfred Spraul
2001-01-10  8:31 ` David S. Miller
2001-01-10 11:25 ` Ingo Molnar
2001-01-10 12:03   ` Manfred Spraul
2001-01-10 12:07     ` Ingo Molnar
2001-01-10 16:18       ` Jamie Lokier
2001-01-13 15:43 ` yodaiken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010118185023.A23381@caldera.de \
    --to=hch@ns.caldera.de \
    --cc=kiobuf-io-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=riel@conectiva.com.br \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox