From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [RFC][PATCH] kmap_atomic_push Date: Fri, 09 Oct 2009 00:57:16 +0200 Message-ID: <1255042636.17055.33.camel@laptop> References: <1255016123.17055.17.camel@laptop> <20091008155344.GA11727@elte.hu> <1255019362.26976.311.camel@twins> <4ACE674E.30403@hp.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4ACE674E.30403@hp.com> Sender: linux-kernel-owner@vger.kernel.org To: jim owens Cc: Hugh Dickins , Linus Torvalds , Ingo Molnar , Avi Kivity , Andrew Morton , David Howells , lkml , linux-arch List-Id: linux-arch.vger.kernel.org On Thu, 2009-10-08 at 18:27 -0400, jim owens wrote: > So if I understand this correctly, the sequence: > > in = kmap_atomic(inpage, KM_USER1); > > out = kmap_atomic(outpage, KM_USER0); > > kunmap_atomic(in, KM_USER1); > > in = kmap_atomic(next_inpage, KM_USER1); > > is now illegal with this patch, which breaks code > I am testing now for btrfs. > > My code does this because the in/out are zlib inflate > and the in/out run at different rates. You can do things like: do { in = kmap_atomic(inpage); out = kmap_atomic(outpage); kunmap_atomic(outpage); kunmap_atomic(inpage); cond_resched(); } while () The double unmap gives a preemption point, which sounds like a good thing to have, because your scheme could run for a long while without enabling preemption, which is badness. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from casper.infradead.org ([85.118.1.10]:36868 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757447AbZJHW6S (ORCPT ); Thu, 8 Oct 2009 18:58:18 -0400 Subject: Re: [RFC][PATCH] kmap_atomic_push From: Peter Zijlstra In-Reply-To: <4ACE674E.30403@hp.com> References: <1255016123.17055.17.camel@laptop> <20091008155344.GA11727@elte.hu> <1255019362.26976.311.camel@twins> <4ACE674E.30403@hp.com> Content-Type: text/plain Date: Fri, 09 Oct 2009 00:57:16 +0200 Message-ID: <1255042636.17055.33.camel@laptop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: jim owens Cc: Hugh Dickins , Linus Torvalds , Ingo Molnar , Avi Kivity , Andrew Morton , David Howells , lkml , linux-arch Message-ID: <20091008225716.5HoUsvyB7qVKgTo4NhSlirlB_rg94iF6moF-XMArH6g@z> On Thu, 2009-10-08 at 18:27 -0400, jim owens wrote: > So if I understand this correctly, the sequence: > > in = kmap_atomic(inpage, KM_USER1); > > out = kmap_atomic(outpage, KM_USER0); > > kunmap_atomic(in, KM_USER1); > > in = kmap_atomic(next_inpage, KM_USER1); > > is now illegal with this patch, which breaks code > I am testing now for btrfs. > > My code does this because the in/out are zlib inflate > and the in/out run at different rates. You can do things like: do { in = kmap_atomic(inpage); out = kmap_atomic(outpage); kunmap_atomic(outpage); kunmap_atomic(inpage); cond_resched(); } while () The double unmap gives a preemption point, which sounds like a good thing to have, because your scheme could run for a long while without enabling preemption, which is badness.