public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lou Langholtz <ldl@aros.net>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
	Steven Whitehouse <steve@chygwyn.com>,
	akpm@digeo.com
Subject: Re: [RFC][PATCH] nbd driver for 2.5.72
Date: Sat, 21 Jun 2003 14:23:33 -0600	[thread overview]
Message-ID: <3EF4BEC5.1060301@aros.net> (raw)
In-Reply-To: <20030621193124.GK6754@parcelfarce.linux.theplanet.co.uk>

viro@parcelfarce.linux.theplanet.co.uk wrote:

>On Sat, Jun 21, 2003 at 10:39:12AM -0600, Lou Langholtz wrote:
>  
>
>>>Why not put these into nbd_device?
>>>
>>>      
>>>
>>I'd considered that and I'm reconsidering it again now. Not convinced 
>>which way to go... Putting something as large as struct request_queue 
>>within the nbd_device seems unbalanced somehow. Then again, until 2.5 
>>the request_queue was typically shared by multiple devices of the same 
>>MAJOR so part of the way the code is has to do with the legacy code. 
>>Like the nbd_lock spinlock array and the struct request_queue queue_lock 
>>field. Along the lines you're pushing for, why not have struct 
>>requests_queue's queue_lock field then be the spinlock itself instead of 
>>just being a pointer to a spinlock???
>>    
>>
>
>Because often that lock protects driver-internal objects that are used
>by all queues.
>
Not sure I understand what you're saying... I was going by the kernel 
blk_init_queue(q, rfn, lock) source that assigns q->queue_lock to the 
given lock pointer. Given how big struct request_queue was compared to a 
spinlock_t and since we require all disks to have there very own 
seperate struct request_queue (by virtue of all the sysfs stuff imbedded 
now in there), I'm pursauded to find requiring each request_queue to 
have its very own lock (by making queue_lock a spinlock_t rather than a 
pointer to such) a relatively low weighted addition for worthwhile gain. 
I don't doubt that I've missed something though. So unless some more 
experienced folks chime in for having queue_lock become a spinlock_t 
instead of spinlock_t *, I'll just not say anymore about queue_lock.

>Prefered variant (actually, we'll have to do it in 2.5 anyway) is to
>allocate request_queue dynamically.  Just put a pointer to it into nbd_device.
>
The best suggestion I've gotten so far was from Andrew Morton who 
rightfully said this patch was enormous. His comment was that it should 
be broken into separate logical patches which I'm working on now as the 
highest priority. I'm about to send out a comparitively miniscule patch 
that is meant as a start toward breaking this all down. It's probably 
the most critical changes currently needed by nbd anyway just to get it 
back to a usable state in 2.5 (for example try to rmmod nbd in 2.5.72 
and earlier - the result corrupts memory). The reason I mention this is 
because putting a pointer to the request_queue struct probably wouldn't 
happen then for a while till I get through enough incremental patches.

>BTW, could you please kill the ..._t silliness?  There is nothing wroung
>with using 'struct nbd_device' directly.
> 
>
Will do. Personally, I like the _t silliness, but then I can see the 
value enough either way and agree that consistancy tips any possible 
balance. ;-)

>. . .
>htonl() honours constants.  If it doesn't, we are in for much more serious
>problems, simply because a lot of codepaths in networking are using it.
>A lot.  IOW, you are obfuscating code for no good reason (and add an extra
>memory access, thus giving actually worse code - it's not an optimisation
>at all).
>  
>
Okay. I'll definately change this too. Thanks again for all your 
feedback!!!!


  reply	other threads:[~2003-06-21 20:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-21  5:43 [RFC][PATCH] nbd driver for 2.5.72 Lou Langholtz
2003-06-21  6:23 ` Pavel Machek
2003-06-21  6:36 ` Bernd Eckenfels
2003-06-21  7:42   ` Wichert Akkerman
2003-06-23  9:05   ` Lars Marowsky-Bree
2003-06-23 19:21   ` Paul Clements
2003-06-21  6:44 ` Andrew Morton
2003-06-21 15:59   ` Lou Langholtz
2003-06-21  7:04 ` Pavel Machek
2003-06-21  7:32 ` viro
2003-06-21  7:45   ` Sam Ravnborg
2003-06-21 16:39   ` Lou Langholtz
2003-06-21 19:31     ` viro
2003-06-21 20:23       ` Lou Langholtz [this message]
2003-06-22 10:30         ` Jens Axboe
2003-06-22 14:15           ` Lou Langholtz

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=3EF4BEC5.1060301@aros.net \
    --to=ldl@aros.net \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=steve@chygwyn.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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