From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH] fs: Make sync_file_range(2) use WB_SYNC_NONE writeback Date: Wed, 28 Oct 2015 15:18:52 +0100 Message-ID: <20151028141852.GA11575@quack.suse.cz> References: <1445714897-26342-1-git-send-email-jack@suse.com> <20151028093040.GG29811@alap3.anarazel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Andrew Morton , Al Viro To: Andres Freund Return-path: Received: from mx2.suse.de ([195.135.220.15]:36939 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965668AbbJ1OTA (ORCPT ); Wed, 28 Oct 2015 10:19:00 -0400 Content-Disposition: inline In-Reply-To: <20151028093040.GG29811@alap3.anarazel.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Andres, On Wed 28-10-15 10:30:40, Andres Freund wrote: > On 2015-10-24 21:28:17 +0200, Jan Kara wrote: > > These days do_sync_mapping_range() went away and we can switch > > sync_file_range(2) back to issuing WB_SYNC_NONE writeback. That should > > help PostgreSQL avoid large latency spikes when flushing data in the > > background. > > > > diff --git a/fs/sync.c b/fs/sync.c > > index fbc98ee62044..ef60e812d771 100644 > > --- a/fs/sync.c > > +++ b/fs/sync.c > > @@ -343,7 +343,8 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes, > > } > > > > if (flags & SYNC_FILE_RANGE_WRITE) { > > - ret = filemap_fdatawrite_range(mapping, offset, endbyte); > > + ret = __filemap_fdatawrite_range(mapping, offset, endbyte, > > + WB_SYNC_NONE); > > if (ret < 0) > > goto out_put; > > } > > Thanks. Would scheduling a comparative benchmark of this be helpful > pushing htis forward ? Would probably only be early next week, I'm at > the european postgresql conference right now. If you could run it, it would be nice. Thanks! Honza -- Jan Kara SUSE Labs, CR