mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Tomas <alex@clusterfs.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Alex Tomas <alex@clusterfs.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	<ext2-devel@lists.sourceforge.net>, Andrew Morton <akpm@osdl.org>
Subject: Re: [Ext2-devel] [PATCH] JBD: journal_release_buffer()
Date: Tue, 25 Jan 2005 22:30:58 +0300	[thread overview]
Message-ID: <m3k6q18fwt.fsf@bzzz.home.net> (raw)
In-Reply-To: <1106670089.1985.766.camel@sisko.sctweedie.blueyonder.co.uk> (Stephen C. Tweedie's message of "Tue, 25 Jan 2005 16:21:30 +0000")

>>>>> Stephen C Tweedie (SCT) writes:

 >> journal_dirty_metadata(handle, bh)
 >> {
 >>     transaction->t_reserved--;
 >>     handle->h_buffer_credits--;
 >>     if (jh->b_tcount > 0) {
 >>         /* modifed, no need to track it any more */
 >>          transaction-> t_outstanding_credits++;
 >>        jh-> b_tcount = -1;
 >>      }
 >> }

 SCT> Actually, the whole thing can be wrapped in if (jh->b_tcount > 0) {}, I
 SCT> think.  If we have already charged the transaction for this buffer, then
 SCT> there's no need to charge the handle for it again.  That's going to be
 SCT> particularly important for truncate(), where we are continually updating
 SCT> the same blocks (eg. bitmap, indirect blocks), so we want to make sure
 SCT> that after the first journal_dirty_metadata() call, no further charge is
 SCT> made.

the idea is:
1) the sooner we drop reservation, the higher probability to cover many
   changes by single transaction
1) having h_buffer_credits being decremented for each modification
   could help us to debug handle overflow situations

 SCT> If we do that, do we in fact need t_reserved at all?

hmm. if t_outstanding_credits holds number of modified buffers,
then we need sum of all running h_buffer_credits to protect
from transaction overflow. t_reserved is sum of h_buffer_credits.


thanks, Alex


  reply	other threads:[~2005-01-25 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 15:32 Alex Tomas
2005-01-24 22:05 ` [Ext2-devel] " Stephen C. Tweedie
2005-01-24 22:24   ` Alex Tomas
2005-01-24 23:35     ` Stephen C. Tweedie
2005-01-25  0:08       ` Alex Tomas
2005-01-25 14:36       ` Alex Tomas
2005-01-25 16:21         ` Stephen C. Tweedie
2005-01-25 19:30           ` Alex Tomas [this message]
2005-01-26 17:12             ` Stephen C. Tweedie
2005-01-30 10:55               ` Alex Tomas
2005-02-04 23:45                 ` Stephen C. Tweedie

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=m3k6q18fwt.fsf@bzzz.home.net \
    --to=alex@clusterfs.com \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.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

all inboxes | Powered by JetHome®