All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Lukas Czerner <lczerner@redhat.com>,
	linux-ext4@vger.kernel.org, jmoyer@redhat.com,
	rwheeler@redhat.com, eshishki@redhat.com, sandeen@redhat.com,
	jack@suse.cz, tytso@mit.edu
Subject: Re: [PATCH 2/3] Add batched discard support for ext3
Date: Thu, 5 Aug 2010 16:00:20 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1008051559140.3063@localhost> (raw)
In-Reply-To: <6EE76C8F-765F-41F3-927E-BFC156A7D324@dilger.ca>

On Wed, 4 Aug 2010, Andreas Dilger wrote:

> On 2010-08-04, at 07:44, Lukas Czerner wrote:
> > +		/*
> > +		 * Clear bits in the bitmap
> > +		 */
> > +		for (bit = start; bit < next; bit++) {
> > +			BUFFER_TRACE(bitmap_bh, "clear bit");
> > +			if (!ext3_clear_bit_atomic(sb_bgl_lock(sbi, group),
> > +						bit, bitmap_bh->b_data)) {
> > +				ext3_error(sb, __func__,
> > +					"bit already cleared for block "E3FSBLK,
> > +					 (unsigned long)bit);
> > +				BUFFER_TRACE(bitmap_bh, "bit already cleared");
> > +			} else {
> > +				freed++;
> > +			}
> > +		}
> > +
> > +		/* Update couters */
> > +		spin_lock(sb_bgl_lock(sbi, group));
> > +		le16_add_cpu(&gdp->bg_free_blocks_count, freed);
> > +		spin_unlock(sb_bgl_lock(sbi, group));
> > +		percpu_counter_add(&sbi->s_freeblocks_counter, next - start);
> 
> It wouldn't be a terrible idea to put this code into a helper function that is shared with ext3_free_blocks_sb() so that it is kept in sync.  There are a lot of places that need to be kept coordinated (disk bitmap, memory bitmap, group descriptor, percpu counter) so I'd like that to be localized to one part of the code.
> 
> 
> Cheers, Andreas
> 

Ok, I will see what I can do with that.

Thanks.

-Lukas

  reply	other threads:[~2010-08-05 14:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 13:44 [PATCH 1/3] Add ioctl FITRIM Lukas Czerner
2010-08-04 13:44 ` [PATCH 2/3] Add batched discard support for ext3 Lukas Czerner
2010-08-04 14:03   ` Jan Kara
2010-08-04 14:32     ` Lukas Czerner
2010-08-04 19:39   ` Andreas Dilger
2010-08-05 14:00     ` Lukas Czerner [this message]
2010-08-04 13:44 ` [PATCH 3/3] Add batched discard support for ext4 Lukas Czerner
2010-08-04 14:17   ` Jan Kara
2010-08-04 14:57 ` [PATCH 1/3] Add ioctl FITRIM Dmitry Monakhov
2010-08-04 15:13   ` Lukas Czerner
2010-08-04 15:26     ` Greg Freemyer
2010-08-05  0:28       ` Ted Ts'o
2010-08-05  6:51         ` Dmitry Monakhov
2010-08-05 15:47         ` Andreas Dilger
2010-08-05  7:00     ` Dmitry Monakhov
2010-08-05  8:36       ` Lukas Czerner
  -- strict thread matches above, loose matches on Subject: below --
2010-08-10 14:19 [PATCH 0/3 ver. 7] Ext3/Ext4 Batched discard support Lukas Czerner
2010-08-10 14:19 ` [PATCH 2/3] Add batched discard support for ext3 Lukas Czerner
2010-08-06 11:31 [PATCH 0/3] Batched discard support Lukas Czerner
2010-08-06 11:31 ` [PATCH 2/3] Add batched discard support for ext3 Lukas Czerner
2010-07-27 12:41 [PATCH 0/3 v3] Batched discard support for Ext3/Ext4 Lukas Czerner
2010-07-27 12:41 ` [PATCH 2/3] Add batched discard support for ext3 Lukas Czerner
2010-07-27 15:43   ` Jan Kara
2010-07-28  9:13     ` Lukas Czerner

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=alpine.LFD.2.00.1008051559140.3063@localhost \
    --to=lczerner@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=eshishki@redhat.com \
    --cc=jack@suse.cz \
    --cc=jmoyer@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rwheeler@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.