From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Date: Thu, 06 Nov 2014 21:50:03 +0000 Subject: Re: [PATCH v9 11/12] x86, mpx: cleanup unused bound tables Message-Id: <545BED0B.8000001@intel.com> List-Id: References: <1413088915-13428-1-git-send-email-qiaowei.ren@intel.com> <1413088915-13428-12-git-send-email-qiaowei.ren@intel.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Gleixner , Qiaowei Ren Cc: "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 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Nov 2014 22:50:12 +0100 (CET) Received: from mga14.intel.com ([192.55.52.115]:65495 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27012832AbaKFVuL0yWN- (ORCPT ); Thu, 6 Nov 2014 22:50:11 +0100 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 06 Nov 2014 13:43:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="412659345" Received: from unknown (HELO [10.255.13.117]) ([10.255.13.117]) by FMSMGA003.fm.intel.com with ESMTP; 06 Nov 2014 13:41:28 -0800 Message-ID: <545BED0B.8000001@intel.com> Date: Thu, 06 Nov 2014 13:50:03 -0800 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Thomas Gleixner , Qiaowei Ren CC: "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 References: <1413088915-13428-1-git-send-email-qiaowei.ren@intel.com> <1413088915-13428-12-git-send-email-qiaowei.ren@intel.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 43885 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: dave.hansen@intel.com Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by kanga.kvack.org (Postfix) with ESMTP id 396826B00CB for ; Thu, 6 Nov 2014 16:50:26 -0500 (EST) Received: by mail-pd0-f173.google.com with SMTP id v10so1939992pde.32 for ; Thu, 06 Nov 2014 13:50:26 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTP id h2si7125506pdk.90.2014.11.06.13.50.23 for ; Thu, 06 Nov 2014 13:50:24 -0800 (PST) Message-ID: <545BED0B.8000001@intel.com> Date: Thu, 06 Nov 2014 13:50:03 -0800 From: Dave Hansen MIME-Version: 1.0 Subject: Re: [PATCH v9 11/12] x86, mpx: cleanup unused bound tables References: <1413088915-13428-1-git-send-email-qiaowei.ren@intel.com> <1413088915-13428-12-git-send-email-qiaowei.ren@intel.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Thomas Gleixner , Qiaowei Ren Cc: "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 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? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org