Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3579559ima; Tue, 23 Oct 2018 08:06:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5fbJPlS0Nh72Nn4ol7zGaW+NSfvKPckL3n+8wgFXyIWqg/SgOASDxMi9TrIIkZ2TwIdEXKq X-Received: by 2002:a17:902:6948:: with SMTP id k8-v6mr2267627plt.22.1540307174417; Tue, 23 Oct 2018 08:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540307174; cv=none; d=google.com; s=arc-20160816; b=F+6lEA97pCkdPkxRHM+fwi7cIatj8bT5rnvYPxC7NWkx3c9np9H3WoH8zCqX5iQPd/ uW4OahYnkeZ/Ww0EUCtQXRX6V578UIHRptH4gue0bB7x/vxi7GrXp7NivC9MDS232c1N Zpnu12UqCMmVDwFaL20WIldiQjZ1e1QqCu1MfLXwtMWtDfGMcdZsAgj30C5vSoaBHjjB VmwZAHApJtE3xKXe7eXvV3tCLpf55/Ne2yT+SJCK3qpMcP1cqD8uK5NlOxEBGyg524YL tjsQizHvGZtP7ldZORYq39nwmTcX58HiJxLv0vmEhEmEHCM1ahhfRyN0+U5/C6epJMKy 4X9w== 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; bh=51F0cMjXzeQLMF/DN3OHvAeqaDi5zhcUpb4gmQRbxIE=; b=v9q+RjXPfXQS90jmjNUHnN7lRUVunOp698TL+Ph2uPAvwLwE47Asz1qqXA3f5C+IIh f/MIne74tMz/a3flat5PgfJlSQwHrd9DX1DAURd9KUKCH9oD5ZquQVGemOc4PLRQGm6l 63DqlwJDMD1S0lKwoPbEMNEAWDuUWMPwtbOcOK5SsFZqqY59/uCBDBTO6KfGDeoF7DIW 71CMYnNgCdrozP+LSlkAYTDs9APG6BavotiDheZ8UPJLZHxcCG78Nt+Dx+7We9YOX0md urwNnm1pCLJw7L0vUfBe6j/6Rp5x6C86zS8DcRC2FTPx7qJHVRey2+3W4glKsunkCBnl iQkg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc15-v6si1554788plb.201.2018.10.23.08.05.50; Tue, 23 Oct 2018 08:06:14 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbeJWX1L (ORCPT + 99 others); Tue, 23 Oct 2018 19:27:11 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:37729 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbeJWX1L (ORCPT ); Tue, 23 Oct 2018 19:27:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 3B7022103C; Tue, 23 Oct 2018 15:03:23 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tKbjgDn9uMwD; Tue, 23 Oct 2018 15:03:23 +0000 (UTC) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id D6D1A2100E; Tue, 23 Oct 2018 15:03:02 +0000 (UTC) Subject: Re: [RFC PATCH 0/2] improve vmalloc allocation To: Michal Hocko , Uladzislau Rezki , Kees Cook Cc: Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, LKML , Thomas Garnier , Oleksiy Avramchenko , Steven Rostedt , Joel Fernandes , Thomas Gleixner , Ingo Molnar , Tejun Heo , Shuah Khan References: <20181019173538.590-1-urezki@gmail.com> <20181022125142.GD18839@dhcp22.suse.cz> <20181022165253.uphv3xzqivh44o3d@pc636> <20181023072306.GN18839@dhcp22.suse.cz> From: Shuah Khan Message-ID: Date: Tue, 23 Oct 2018 09:02:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181023072306.GN18839@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 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 Hi Michal, On 10/23/2018 01:23 AM, Michal Hocko wrote: > Hi Shuah, > > On Mon 22-10-18 18:52:53, Uladzislau Rezki wrote: >> On Mon, Oct 22, 2018 at 02:51:42PM +0200, Michal Hocko wrote: >>> Hi, >>> I haven't read through the implementation yet but I have say that I >>> really love this cover letter. It is clear on intetion, it covers design >>> from high level enough to start discussion and provides a very nice >>> testing coverage. Nice work! >>> >>> I also think that we need a better performing vmalloc implementation >>> long term because of the increasing number of kvmalloc users. >>> >>> I just have two mostly workflow specific comments. >>> >>>> A test-suite patch you can find here, it is based on 4.18 kernel. >>>> ftp://vps418301.ovh.net/incoming/0001-mm-vmalloc-stress-test-suite-v4.18.patch >>> >>> Can you fit this stress test into the standard self test machinery? >>> >> If you mean "tools/testing/selftests", then i can fit that as a kernel module. >> But not all the tests i can trigger from kernel module, because 3 of 8 tests >> use __vmalloc_node_range() function that is not marked as EXPORT_SYMBOL. > > Is there any way to conditionally export these internal symbols just for > kselftests? Or is there any other standard way how to test internal > functionality that is not exported to modules? > The way it can be handled is by adding a test module under lib. test_kmod, test_sysctl, test_user_copy etc. There is a corresponding test script e.g selftests/kmod/kmod.sh that loads the module and runs tests. Take a look at lib/test_overflow.c - It is running some vmalloc_node tests test_overflow.c:DEFINE_TEST_ALLOC(vmalloc_node, vfree, 0, 0, 1); test_overflow.c:DEFINE_TEST_ALLOC(kvmalloc_node, kvfree, 0, 1, 1); test_overflow.c: err |= test_kvmalloc_node(NULL); test_overflow.c: err |= test_vmalloc_node(NULL); This module could be extended to tun these stress tests perhaps? I don't see a selftests test script for test_overflow, one could be added. Adding Kees Cook to the thread for input on test_overflow. thanks, -- Shuah