Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3609524ima; Tue, 23 Oct 2018 08:29:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Qnl3TmuaYTt8VT7sMNfNqKh3DO0DjouItWt03Z3Na190FgTEP/0a07Hwl3FKJLVR6W6Ul X-Received: by 2002:a17:902:e01:: with SMTP id 1-v6mr43698810plw.207.1540308599483; Tue, 23 Oct 2018 08:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540308599; cv=none; d=google.com; s=arc-20160816; b=fyBlLQhudS1yChs3773nS9Hj4pMoU86pkUTnTQ2Nusb5SxCuAt9b7aqGRtwIA5VATD OMxREXkqpw9Lz+5w+DBkAr3ZKbUZev2oRFi5zCZgd8aTrEKaRn426WLK3mKNfix6lfyr RkSOYLKFXxo38nMNSBIKihLE3nib2FNt6us7pAC5bKG7fjVWjxCRFlSX6dBFnaYPM1ig b0GPOoCUrMeb80RCVbsq+jg/E4fp/Mjj7t71AfSw3nWABEuPQ93VeotslPbjLamuOEWk wBq4LaWw9V5argKm2x8MJ5eUcK5LC14+8vzoeZHAPe7XXDffcpYdMwnIH8Lrx4M2fAz9 AHhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5d6BfSSnqZv5s5EkgVe/s7U5D4MKONerriVnO9DzggY=; b=XSjPDU31wzeXx9lXsDhwyi3Rvnqmrlp/2B0q8WCaaSnkXdN1RvMYAGIHX05D7TZO1+ nBN6Zb1EP+phldksgiTZ0+fOdRcmPW+C3plDssh/QC2/fsXZbtQGWhRVn3eBjdXZNXIO JTYE+QIllJLd9wVHyUe4sLj3Y9KFwQmc6Cx1sWlkAdypAfQGGHQEiB0JeELeqxMarxFg swCr2+VikaiQ7ct/rDzy58RDGp4+bOI0sq86TDkt2qdcXaN1rMw8bfOrAl/nN/zdrabj sewjAzAAUdzUKj8E3yJ5kXjIIyGovOf0XbefWh9nATTQcP42OD6ZiVGiKaVcsmhBzDxy BePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iKoiWVS5; 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 c22-v6si1514283pgk.292.2018.10.23.08.29.43; Tue, 23 Oct 2018 08:29:59 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iKoiWVS5; 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 S1728137AbeJWXug (ORCPT + 99 others); Tue, 23 Oct 2018 19:50:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55436 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726970AbeJWXug (ORCPT ); Tue, 23 Oct 2018 19:50:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5d6BfSSnqZv5s5EkgVe/s7U5D4MKONerriVnO9DzggY=; b=iKoiWVS5QPZEtUonfO5txCoTg GQZyl+lxvsfr6OH2HAw7KHkNO6DwQCwT9nPIJ6Wj5jbv3QBpJZaWYpTWG7wxqnxB7a+cPYpBvkktF 88/zrzdgCM6YFp0s3mZPsoVbpui3YgnIlzGEvYfxoMnzNv5cBsQqnVKsE0ILeFSIw1Ba99ddkH2YT /e4vBddEvmB64Z+EKTpjWJVPj/64nvYdcaL89VAiTWJKsJO9yLxDDGLbZUWNAbn9Rt67Q3/U7tUvd E6z8J+pMhRMZLCFVIDziOhmmGuIDiFEU+8bWMxehfUZNgXt0cGwGfsnjCwi+xq14frT9LuE0SCWO+ zQawPECqA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyZs-0001My-GN; Tue, 23 Oct 2018 15:26:40 +0000 Date: Tue, 23 Oct 2018 08:26:40 -0700 From: Matthew Wilcox To: Shuah Khan Cc: Michal Hocko , Uladzislau Rezki , Kees Cook , Andrew Morton , linux-mm@kvack.org, LKML , Thomas Garnier , Oleksiy Avramchenko , Steven Rostedt , Joel Fernandes , Thomas Gleixner , Ingo Molnar , Tejun Heo Subject: Re: [RFC PATCH 0/2] improve vmalloc allocation Message-ID: <20181023152640.GD20085@bombadil.infradead.org> References: <20181019173538.590-1-urezki@gmail.com> <20181022125142.GD18839@dhcp22.suse.cz> <20181022165253.uphv3xzqivh44o3d@pc636> <20181023072306.GN18839@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 23, 2018 at 09:02:56AM -0600, Shuah Khan wrote: > 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. The problem is that said module can only invoke functions which are exported using EXPORT_SYMBOL. And there's a cost to exporting them, which I don't think we're willing to pay, purely to get test coverage. Based on my own experience with the IDA & XArray test suites, I would like to propose a solution which does not require exporting all of these symbols: Create a new kernel module in mm/test_vmalloc.c Towards the top of that file, #include #undef EXPORT_SYMBOL #define EXPORT_SYMBOL(x) /* */ #include "vmalloc.c" Now you can invoke even static functions from your test harness.