public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: jim owens <jowens@hp.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Avi Kivity <avi@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>
Subject: Re: [RFC][PATCH] kmap_atomic_push
Date: Fri, 09 Oct 2009 00:57:16 +0200	[thread overview]
Message-ID: <1255042636.17055.33.camel@laptop> (raw)
In-Reply-To: <4ACE674E.30403@hp.com>

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);

 <deflate until end of either in/out>

 kunmap_atomic(outpage);
 kunmap_atomic(inpage);

 cond_resched();

 <iterate bits>

} while (<not done>)

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.

  parent reply	other threads:[~2009-10-08 22:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 15:35 [RFC][PATCH] kmap_atomic_push Peter Zijlstra
2009-10-08 15:44 ` Linus Torvalds
2009-10-08 15:53 ` Ingo Molnar
2009-10-08 15:53   ` Ingo Molnar
2009-10-08 16:29   ` Peter Zijlstra
2009-10-08 16:29     ` Peter Zijlstra
2009-10-08 16:50     ` Linus Torvalds
2009-10-08 18:02       ` Hugh Dickins
2009-10-08 22:27         ` jim owens
2009-10-08 22:32           ` Peter Zijlstra
2009-10-08 22:57           ` Peter Zijlstra [this message]
2009-10-08 22:57             ` Peter Zijlstra
2009-10-09 12:15             ` jim owens
2009-10-09 12:15               ` jim owens
2009-10-08 22:12 ` David Howells
2009-10-08 22:12   ` David Howells
2009-10-08 22:29   ` Peter Zijlstra
2009-10-08 22:58     ` David Howells
2009-10-08 22:42 ` Peter Zijlstra
2009-10-12 18:10 ` Andi Kleen
2009-10-12 18:10   ` Andi Kleen
2009-10-12 18:30   ` Linus Torvalds
2009-10-12 18:40     ` Andi Kleen
2009-10-12 18:40       ` Andi Kleen

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=1255042636.17055.33.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=jowens@hp.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox