Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751614AbaKKS1v (ORCPT ); Tue, 11 Nov 2014 13:27:51 -0500 Received: from www.linutronix.de ([62.245.132.108]:37298 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087AbaKKS1u (ORCPT ); Tue, 11 Nov 2014 13:27:50 -0500 Date: Tue, 11 Nov 2014 19:27:37 +0100 (CET) From: Thomas Gleixner To: Dave Hansen cc: Qiaowei Ren , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH v9 11/12] x86, mpx: cleanup unused bound tables In-Reply-To: <545BED0B.8000001@intel.com> Message-ID: References: <1413088915-13428-1-git-send-email-qiaowei.ren@intel.com> <1413088915-13428-12-git-send-email-qiaowei.ren@intel.com> <545BED0B.8000001@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Nov 2014, Dave Hansen wrote: > Instead of all of these games with dropping and reacquiring mmap_sem and > adding other locks, or deferring the work, why don't we just do a > get_user_pages()? Something along the lines of: > > while (1) { > ret = cmpxchg(addr) > if (!ret) > break; > if (ret == -EFAULT) > get_user_pages(addr); > } > > Does anybody see a problem with that? You want to do that under mmap_sem write held, right? Not a problem per se, except that you block normal faults for a possibly long time when the page(s) need to be swapped in. But yes, this might solve most of the issues at hand. Did not think about GUP at all :( Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/