Mailinglist Archive: packet-writing (116 mails)

< Previous Next >
Re: Packet patch for 2.4.19
  • From: Jens Axboe <axboe@xxxxxxx>
  • Date: Thu, 8 Aug 2002 06:15:53 +0000 (UTC)
  • Message-id: <20020808061545.GB17187@xxxxxxx>
On Thu, Aug 08 2002, Peter Osterlund wrote:
> On Thu, 8 Aug 2002, Jens Axboe wrote:
>
> > Also, when ext3 gets fixed to not abuse b_private in mid-air, packet can
> > switch to using a smaller stacking unit than a full buffer_head (these
> > babies are huge in 2.4).
>
> Will this ever happen in 2.4? The 2.5 code is already better in this

Oh sure it will, it's a good optimization. Not just for packet, but for
the remapping drivers as well. Except 2.4.20 to work.

> respect. No memory is alloced in the pkt_make_request function, unless the
> incoming bio spans a packet boundary. In that case the bio is split up and
> a small data structure (packet_stacked_data) is allocated with
> mempool_alloc to keep track of the pieces.

Yeah, I designed bio to be a purely I/O unit. BTW, it wont be long
before you can make sure that an incoming bio will never span a packet
boundary, for instance. Splitting bio's is evil and will be gone :-)

> > You have one problem in the patch in this mail, though.
> >
> > [snip]
> >
> > See this is fine, pkt_get_stacked_bh() is never called with interrupt
> > disabled and _that_ is why it's safe to use the non flag saving spin
> > locking variants.
> >
> > [snip]
> >
> > pkt_put_stacked_bh() can be though, so you must never use non-saving
> > variants there!
> >
> > The rule of thumb is, always use the _save/_restore versions. Unless you
> > really know what you are doing.
>
> Thanks, will fix. I did know about these rules, but in this case I
> mindlessly copied the locking functions from other parts of the same file.
> Shame on me :-)

90% of bugs are copied from somewhere else :-)

--
Jens Axboe


< Previous Next >