Received: by 10.223.185.116 with SMTP id b49csp1084438wrg; Wed, 21 Feb 2018 11:50:30 -0800 (PST) X-Google-Smtp-Source: AH8x224+HhJ7fwRSY9PzSnkcbqX21B6Mp+KpeloeTBtRf6U0FnMR8HQ1ujCtE+EgILPUkBUCFJAM X-Received: by 10.99.61.75 with SMTP id k72mr3480972pga.384.1519242630561; Wed, 21 Feb 2018 11:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519242630; cv=none; d=google.com; s=arc-20160816; b=O4YCR5+/Muku9Km9Kn7a0K8mGMtPjHGq26QYTiR1fyddsr1fYxAEahJ3ECz52x8xmo 9KoBf9kMcW/gmlIaXUs5mc0pm8uu5NU9ND+Wn52ahY79dRkh7woP4nxYh8KL0HsBwWxb T6D3iCsPjkBG42a3LougvHd2JR9POlX6b4GxSm50G3EdKGE70Yfv4zeVa6PNxhwOLMnQ 86X1cQF0eLMuDprPDz2AHX7Z29UVmiuhN5Mb1jYTSG0LGWRBViE8iuFRtHReve0EtZmd 3aCJ5OP7Wg3xIpNIHZwmZU3jDNHc+66+V8c1rC0voe4y37wqF3+Ohj1aJRIA2Q7i+xiH HioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=jg7F26p9Uvdy4eGcQsjc8O5FyJxlr3MBnANQjxhiw5A=; b=Glhk9f8kqQBgYGo0mXcYv+qr5r/HgIvVnTQdTqW3fAeE/ncEcQOn+u2G1AfytfVwqf v0fkt4W5Dm0SujZzv+lYucsKjfUsbO1xCFS+4/1fbq8BzaSYNMdeNCBjFOSp8cuE56Br LjnegbpySRiiCpoh4vkwTzYannfTd3XXZEGKEIX9XNX9KfdmYqnzPmjGfa9vrTm3lGNs JxlNIGUL4yyr8n+GonGPiKavtmUS48eXvAEDFDpDQk3pr0Y7dgrh99T35mXwd4IxOm7M CQziv0uv7q9J7yO3YD5ozRLM6eeURh0Uqk7PurJACvYQ/GtqYxH0cojUb/BeX0ophFNn 344A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10-v6si916640plt.185.2018.02.21.11.50.16; Wed, 21 Feb 2018 11:50:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935903AbeBUQgC (ORCPT + 99 others); Wed, 21 Feb 2018 11:36:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:34028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932880AbeBUQf7 (ORCPT ); Wed, 21 Feb 2018 11:35:59 -0500 Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E13A2217B5 for ; Wed, 21 Feb 2018 16:35:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E13A2217B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-io0-f177.google.com with SMTP id p78so2724142iod.13 for ; Wed, 21 Feb 2018 08:35:58 -0800 (PST) X-Gm-Message-State: APf1xPCTpBlRGHb5B4Ybmri0PvDNaa+0Pqn8Ws6vduat0ELVMi4Wkudx EJeiO1yfFpp5LfhCnqO5b54h95tObKIRBLFPuwr2uw== X-Received: by 10.107.174.14 with SMTP id x14mr4887441ioe.67.1519230958111; Wed, 21 Feb 2018 08:35:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.101 with HTTP; Wed, 21 Feb 2018 08:35:37 -0800 (PST) In-Reply-To: References: <151670492223.658225.4605377710524021456.stgit@buzz> <151670492913.658225.2758351129158778856.stgit@buzz> <5c19630f-7466-676d-dbbc-a5668c91cbcd@yandex-team.ru> <20180220161634.517598ec63ec4a785c4c81cc@linux-foundation.org> From: Andy Lutomirski Date: Wed, 21 Feb 2018 16:35:37 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/4] kernel/fork: switch vmapped stack callation to __vmalloc_area() To: Konstantin Khlebnikov Cc: Andrew Morton , Dave Hansen , LKML , Christoph Hellwig , Linux-MM , Andy Lutomirski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 21, 2018 at 7:23 AM, Konstantin Khlebnikov wrote: > > > On 21.02.2018 03:16, Andrew Morton wrote: >> >> On Tue, 23 Jan 2018 16:57:21 +0300 Konstantin Khlebnikov >> wrote: >> >>> # stress-ng --clone 100 -t 10s --metrics-brief >>> at 32-core machine shows boost 35000 -> 36000 bogo ops >>> >>> Patch 4/4 is a kind of RFC. >>> Actually per-cpu cache of preallocated stacks works faster than buddy >>> allocator thus >>> performance boots for it happens only at completely insane rate of >>> clones. >>> >> >> I'm not really sure what to make of this patchset. Is it useful in any >> known real-world use cases? > > > Not yet. Feel free to ignore last patch. > >> >>> + This option neutralize stack overflow protection but allows to >>> + achieve best performance for syscalls fork() and clone(). >> >> >> That sounds problematic, but perhaps acceptable if the fallback only >> happens rarely. >> >> Can this code be folded into CONFIG_VMAP_STACk in some cleaner fashion? >> We now have options for non-vmapped stacks, vmapped stacks and a mix >> of both. >> >> And what about this comment in arch/Kconfig:VMAP_STACK: >> >> This is presently incompatible with KASAN because KASAN expects >> the stack to map directly to the KASAN shadow map using a >> formula >> that is incorrect if the stack is in vmalloc space. >> >> >> So VMAP_STACK_AS_FALLBACK will intermittently break KASAN? >> > > All of this (including CONFIG_VMAP_STACK) could be turned into boot option. > I think this would be a best solution. Or someone could *fix* KASAN to work with stacks in the vmalloc area.