From patchwork Wed Jan 12 20:53:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 474901 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0CKsC2e011991 for ; Wed, 12 Jan 2011 20:54:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565Ab1ALUyJ (ORCPT ); Wed, 12 Jan 2011 15:54:09 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:53764 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756020Ab1ALUyI (ORCPT ); Wed, 12 Jan 2011 15:54:08 -0500 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) (authenticated bits=0) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p0CKra4p027689 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL); Wed, 12 Jan 2011 12:53:37 -0800 Received: by iyj18 with SMTP id 18so884809iyj.19 for ; Wed, 12 Jan 2011 12:53:34 -0800 (PST) Received: by 10.231.36.139 with SMTP id t11mr1563155ibd.91.1294865614619; Wed, 12 Jan 2011 12:53:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.31.72 with HTTP; Wed, 12 Jan 2011 12:53:14 -0800 (PST) In-Reply-To: <4D2E1010.4080706@redhat.com> References: <4D2ACFA7.6000502@redhat.com> <4D2C21FE.3000406@redhat.com> <4D2E1010.4080706@redhat.com> From: Linus Torvalds Date: Wed, 12 Jan 2011 12:53:14 -0800 Message-ID: Subject: Re: [GIT PULL] KVM updates for the 2.6.38 merge window To: Rik van Riel Cc: Avi Kivity , Marcelo Tosatti , linux-kernel , KVM list X-Spam-Status: No, hits=-3.479 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 12 Jan 2011 20:54:13 +0000 (UTC) include/linux/mm.h | 1 + mm/filemap.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 721f451..dc83565 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -145,6 +145,7 @@ extern pgprot_t protection_map[16]; #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ +#define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ /* * This interface is used by x86 PAT code to identify a pfn mapping that is diff --git a/mm/filemap.c b/mm/filemap.c index ca38939..10eecf7 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -621,8 +621,10 @@ int __lock_page_or_retry(struct page *page, struct mm_struct *mm, __lock_page(page); return 1; } else { - up_read(&mm->mmap_sem); - wait_on_page_locked(page); + if (!(flags & FAULT_FLAG_RETRY_NOWAIT)) { + up_read(&mm->mmap_sem); + wait_on_page_locked(page); + } return 0; } }