All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Steven Whitehouse <steve@chygwyn.com>,
	npiggin@suse.de, Andrew Morton <akpm@linux-foundation.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org
Subject: Re: [patch 4/8] mm: write_cache_pages type overflow fix
Date: Fri, 10 Oct 2008 12:10:54 -0400	[thread overview]
Message-ID: <20081010161053.GF16353@mit.edu> (raw)
In-Reply-To: <20081010155447.GA14628@skywalker>

On Fri, Oct 10, 2008 at 09:24:47PM +0530, Aneesh Kumar K.V wrote:
> On Fri, Oct 10, 2008 at 10:08:29AM -0400, Christoph Hellwig wrote:
> > On Fri, Oct 10, 2008 at 10:05:35AM -0400, Theodore Tso wrote:
> > > 3) A version which (optionally via a flag in the wbc structure)
> > > instructs write_cache_pages() to not pursue those updates.  This has
> > > not been written yet.
> > 
> > This one sounds best to me (although we'd have to actualy see it..)
> 
> something like  the below ?
> 
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index bd91987..7599af2 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -63,6 +63,8 @@ struct writeback_control {
>  	unsigned for_writepages:1;	/* This is a writepages() call */
>  	unsigned range_cyclic:1;	/* range_start is cyclic */
>  	unsigned more_io:1;		/* more io to be dispatched */
> +	/* flags which control the write_cache_pages behaviour */
> +	int writeback_flags;
>  };

I don't see a definition for WB_NO_NRWRITE_UPDATE and
WB_NO_INDEX_UPDATE in your patch?

Given the structure seems to be using bitfields for all of the other
fields, why not do this instead?

	unsigned no_nrwrite_update:1;
	unsigned no_index_update:1;

Personally, I'm old school, and prefer using an int flag field and
using #define's for flags, but the rest of the structure is using
bitfields for flags, and it's probably better to be consistent...
	

							- Ted

WARNING: multiple messages have this Message-ID (diff)
From: Theodore Tso <tytso@mit.edu>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Steven Whitehouse <steve@chygwyn.com>,
	npiggin@suse.de, Andrew Morton <akpm@linux-foundation.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org
Subject: Re: [patch 4/8] mm: write_cache_pages type overflow fix
Date: Fri, 10 Oct 2008 12:10:54 -0400	[thread overview]
Message-ID: <20081010161053.GF16353@mit.edu> (raw)
In-Reply-To: <20081010155447.GA14628@skywalker>

On Fri, Oct 10, 2008 at 09:24:47PM +0530, Aneesh Kumar K.V wrote:
> On Fri, Oct 10, 2008 at 10:08:29AM -0400, Christoph Hellwig wrote:
> > On Fri, Oct 10, 2008 at 10:05:35AM -0400, Theodore Tso wrote:
> > > 3) A version which (optionally via a flag in the wbc structure)
> > > instructs write_cache_pages() to not pursue those updates.  This has
> > > not been written yet.
> > 
> > This one sounds best to me (although we'd have to actualy see it..)
> 
> something like  the below ?
> 
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index bd91987..7599af2 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -63,6 +63,8 @@ struct writeback_control {
>  	unsigned for_writepages:1;	/* This is a writepages() call */
>  	unsigned range_cyclic:1;	/* range_start is cyclic */
>  	unsigned more_io:1;		/* more io to be dispatched */
> +	/* flags which control the write_cache_pages behaviour */
> +	int writeback_flags;
>  };

I don't see a definition for WB_NO_NRWRITE_UPDATE and
WB_NO_INDEX_UPDATE in your patch?

Given the structure seems to be using bitfields for all of the other
fields, why not do this instead?

	unsigned no_nrwrite_update:1;
	unsigned no_index_update:1;

Personally, I'm old school, and prefer using an int flag field and
using #define's for flags, but the rest of the structure is using
bitfields for flags, and it's probably better to be consistent...
	

							- Ted

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-10-10 16:11 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 15:50 [patch 0/8] write_cache_pages fixes npiggin
2008-10-09 15:50 ` npiggin
2008-10-09 15:50 ` [patch 1/8] mm: write_cache_pages cyclic fix npiggin
2008-10-09 15:50   ` npiggin
2008-10-09 15:50 ` [patch 2/8] mm: write_cache_pages AOP_WRITEPAGE_ACTIVATE fix npiggin
2008-10-09 15:50   ` npiggin
2008-10-10 16:00   ` Miklos Szeredi
2008-10-10 16:00     ` Miklos Szeredi
2008-10-10 18:29     ` Hugh Dickins
2008-10-11  4:05       ` Nick Piggin
2008-10-11  4:05         ` Nick Piggin
2008-10-09 15:50 ` [patch 3/8] mm: write_cache_pages writepage error fix npiggin
2008-10-09 15:50   ` npiggin
2008-10-09 15:50 ` [patch 4/8] mm: write_cache_pages type overflow fix npiggin
2008-10-09 15:50   ` npiggin
2008-10-09  8:23   ` Christoph Hellwig
2008-10-09  8:23     ` Christoph Hellwig
2008-10-09  8:33     ` Nick Piggin
2008-10-09  8:33       ` Nick Piggin
2008-10-10 13:10     ` Theodore Tso
2008-10-10 13:10       ` Theodore Tso
2008-10-10 13:13       ` Christoph Hellwig
2008-10-10 13:13         ` Christoph Hellwig
2008-10-10 13:37         ` Theodore Tso
2008-10-10 13:37           ` Theodore Tso
2008-10-10 13:48           ` Steven Whitehouse
2008-10-10 13:48             ` Steven Whitehouse
2008-10-10 14:05             ` Theodore Tso
2008-10-10 14:05               ` Theodore Tso
2008-10-10 14:08               ` Christoph Hellwig
2008-10-10 14:08                 ` Christoph Hellwig
2008-10-10 15:54                 ` Aneesh Kumar K.V
2008-10-10 15:54                   ` Aneesh Kumar K.V
2008-10-10 15:59                   ` Chris Mason
2008-10-10 16:10                   ` Theodore Tso [this message]
2008-10-10 16:10                     ` Theodore Tso
2008-10-10 16:34                   ` Christoph Hellwig
2008-10-10 16:34                     ` Christoph Hellwig
2008-10-10 13:56           ` Chris Mason
2008-10-09 15:50 ` [patch 5/8] mm: write_cache_pages integrity fix npiggin
2008-10-09 15:50   ` npiggin
2008-10-09 12:52   ` Chris Mason
2008-10-09 13:27     ` Nick Piggin
2008-10-09 13:27       ` Nick Piggin
2008-10-09 13:35       ` Chris Mason
2008-10-09 13:55         ` Nick Piggin
2008-10-09 13:55           ` Nick Piggin
2008-10-09 14:12           ` Chris Mason
2008-10-09 14:12             ` Chris Mason
2008-10-09 14:21             ` Nick Piggin
2008-10-09 14:21               ` Nick Piggin
2008-10-09 14:39               ` Chris Mason
2008-10-09 14:39                 ` Chris Mason
2008-10-09 14:50                 ` Nick Piggin
2008-10-09 14:50                   ` Nick Piggin
2008-10-09 15:16                   ` Chris Mason
2008-10-09 15:16                     ` Chris Mason
2008-10-10  2:40                     ` Nick Piggin
2008-10-10  2:40                       ` Nick Piggin
2008-10-09 15:50 ` [patch 6/8] mm: write_cache_pages cleanups npiggin
2008-10-09 15:50   ` npiggin
2008-10-09 14:37   ` Artem Bityutskiy
2008-10-09 14:37     ` Artem Bityutskiy
2008-10-09 15:50 ` [patch 7/8] mm: write_cache_pages optimise page cleaning npiggin
2008-10-09 15:50   ` npiggin
2008-10-09 15:50 ` [patch 8/8] mm: write_cache_pages terminate quickly npiggin
2008-10-09 15:50   ` npiggin

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=20081010161053.GF16353@mit.edu \
    --to=tytso@mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mpatocka@redhat.com \
    --cc=npiggin@suse.de \
    --cc=steve@chygwyn.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 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.