Received: by 10.223.185.116 with SMTP id b49csp405804wrg; Tue, 20 Feb 2018 23:56:42 -0800 (PST) X-Google-Smtp-Source: AH8x226QkPne1GZS9oyE/Ah/W9Gic6A3iwkqqEm9+emSObMI8grCD840Ag4cWqkbk+aG1q1SfZR3 X-Received: by 2002:a17:902:6c06:: with SMTP id q6-v6mr2384754plk.142.1519199802056; Tue, 20 Feb 2018 23:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519199802; cv=none; d=google.com; s=arc-20160816; b=TsJBL9D5vw7dcNbs/MBUi/STPER7Y/5/tPFS2t/nAUasa4g2isgZB6M4xRAlDYw5Hs eWUlZPvXAhf7gAEWCAwdui1mNmwEz1xYoLL7UxS1f3i+T0r+LnY4WpMhvBhRUhxqM+fQ LtY8Fj2yJ2d3aXFWkthecx9gJvt6cYNPS4U2FV8ct/jq6hVARPhbOSBhj3nctBaEAor3 mfDpbZXBbsnMJo3PlAOT8qCu332eZoz55Kmm9UInO3f5Rtajomt2WWeBpAiLvJ7GSPFh azKcMeG077ldOdnYNoZu6Tj1xxKDywy2zWxosGttzqx4BnlRUBUPKobUHCmMy9C6SD0d x3fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=mZKcBWumhtpi6HRpNz4ml1+FxsWQ+WagzyzKnmkK0ko=; b=LuankTRVbKXehfLCH8as0ybUojakwGTe4lXOJfZ/LU0AtDwcL2/xKMu7Iq+uElECar 0vvVoSaijdXyKG2MrtOfUDOnNhCGCbmMjQHgj7OiOKdSjwoMzccglPWs8QCtNSSTT2Y2 eM9lspevEGVVY/lyfvw1ggeZ8MobDzhdnrZlcLqRjuCYu0ulaIq+pqJuHlCoW3Tjg2o4 m02PC/+HwdYNliNbwAInYMVGIAQOtJ47PNsZirEtyJP3wgUapANqO+w/ErnhB4zKxsQR 7G2Fswvf8uVisSWHNh6ZHmV5A3MLr4nD9XNJGdwSt5uNLFfLjrltIPVWz7TZZNH0Yvi9 vXmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=n6FHEdya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94-v6si800786plf.451.2018.02.20.23.56.26; Tue, 20 Feb 2018 23:56:42 -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; dkim=pass header.i=@yandex-team.ru header.s=default header.b=n6FHEdya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbeBUHXP (ORCPT + 99 others); Wed, 21 Feb 2018 02:23:15 -0500 Received: from forwardcorp1j.cmail.yandex.net ([5.255.227.105]:39443 "EHLO forwardcorp1j.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbeBUHXO (ORCPT ); Wed, 21 Feb 2018 02:23:14 -0500 Received: from smtpcorp1o.mail.yandex.net (smtpcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::30]) by forwardcorp1j.cmail.yandex.net (Yandex) with ESMTP id 83DAB20E8B; Wed, 21 Feb 2018 10:23:12 +0300 (MSK) Received: from smtpcorp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtpcorp1o.mail.yandex.net (Yandex) with ESMTP id 7AD962440DD5; Wed, 21 Feb 2018 10:23:12 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:40c:894d:7349:a50a:da26]) by smtpcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id pHabxe1lwY-NCfKI7VD; Wed, 21 Feb 2018 10:23:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1519197792; bh=mZKcBWumhtpi6HRpNz4ml1+FxsWQ+WagzyzKnmkK0ko=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=n6FHEdyahpJAM53LdYV9jExLRHOeYVYmeavTNEt3R1AvxtIzX5BXB7pPkzw5EmMBm mQlFMK/tyHBeEMZeVwJR5Fiwv2RvS5Gyw2x7//zcR9LgblsWSVf4A44f9ijAs59B7X oVIDMuZOfKOAaq4dF/x68yfrQVpz9d4eXta9Tl9Q= Authentication-Results: smtpcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: Re: [PATCH 3/4] kernel/fork: switch vmapped stack callation to __vmalloc_area() To: Andrew Morton Cc: Dave Hansen , linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Andy Lutomirski 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: Konstantin Khlebnikov Message-ID: Date: Wed, 21 Feb 2018 10:23:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180220161634.517598ec63ec4a785c4c81cc@linux-foundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.