From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbbHENNY (ORCPT ); Wed, 5 Aug 2015 09:13:24 -0400 Received: from mail-vk0-f46.google.com ([209.85.213.46]:36072 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbbHENNX (ORCPT ); Wed, 5 Aug 2015 09:13:23 -0400 MIME-Version: 1.0 In-Reply-To: <20150805115319.GB25784@node.dhcp.inet.fi> References: <20150728171500.GA2871@www.outflux.net> <20150728143504.5aa996ba5955522a19c2d5f1@linux-foundation.org> <20150728221111.GA23391@node.dhcp.inet.fi> <20150805113854.GA9110@gmail.com> <20150805115319.GB25784@node.dhcp.inet.fi> Date: Wed, 5 Aug 2015 06:13:22 -0700 X-Google-Sender-Auth: CxIY8JU6MfXTl0tmj-yPXTtpt74 Message-ID: Subject: Re: [PATCH] user_ns: use correct check for single-threadedness From: Ricky Zhou To: "Kirill A. Shutemov" Cc: Ingo Molnar , Andrew Morton , Kees Cook , "Eric W. Biederman" , Oleg Nesterov , David Howells , linux-kernel@vger.kernel.org, Peter Zijlstra , "Kirill A. Shutemov" , Rik van Riel , Vladimir Davydov , Ricky Zhou , Julien Tinnes Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 5, 2015 at 4:53 AM, Kirill A. Shutemov wrote: >> 'only' if it's multi-threaded, i.e. when some workload cares so much about >> performance that it uses multiple threads? >> >> Can you see the contradiction there? > > I can. man 2 unshare: > > CLONE_NEWUSER requires that the calling process is not threaded; > > The workload cares so much about performance that it ignores API > requirements. Some slow down looks like a fair price to me. To be fair, the entire reason for this patch is that the slow path (mm_users > 1) can happen even when the process is single-threaded. I was concerned about how expensive current_is_single_threaded looked as well, but didn't see any lightweight alternatives short of adding a field to mm_struct. Do folks think it's worth going down that route instead? Thanks, Ricky