[Top] [All Lists]

Re: XFS realtime O_DIRECT failures

To: Amit Sahrawat <amit.sahrawat83@xxxxxxxxx>
Subject: Re: XFS realtime O_DIRECT failures
From: Alan Cook <acook@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Nov 2011 08:28:48 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <CADDb1s20M0w+yFGa8G=KbAZ6wL4Hj7WUxR0w+hzRH9BCgFWpLQ@xxxxxxxxxxxxxx>
References: <loom.20111108T180925-222@xxxxxxxxxxxxxx> <CADDb1s20M0w+yFGa8G=KbAZ6wL4Hj7WUxR0w+hzRH9BCgFWpLQ@xxxxxxxxxxxxxx>
On Tue, Nov 8, 2011 at 11:20 PM, Amit Sahrawat
<amit.sahrawat83@xxxxxxxxx> wrote:
> In my opinion, this is not the way to allocate memory and use for
> O_DIRECT approach. Instead you can make use of valloc() or
> posix_memalign()/memalign
> Or if you are still using malloc() - then you probably did the right
> thing by allocating for alignment like malloc(size + 4096);
> but, store this is permanent pointer and make use of aligned pointer :
> perm_pointer = malloc(size +4096);
> For aligning you need an expression like this:
> align_pointer = (perm_pointer + 4096) & ~(4095);// If you wish to
> align for 512, do it like (p+512) & ~(511);

Thanks.  I adjusted the test application, but still see the bug with
RT subvolumes and direct writes.

<Prev in Thread] Current Thread [Next in Thread>