From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42652C4727D for ; Wed, 23 Sep 2020 08:35:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAE5F2076A for ; Wed, 23 Sep 2020 08:35:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="OsaHPaOR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAE5F2076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D7B496B0055; Wed, 23 Sep 2020 04:35:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D06526B005C; Wed, 23 Sep 2020 04:35:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCCFF6B005D; Wed, 23 Sep 2020 04:35:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id A44F86B0055 for ; Wed, 23 Sep 2020 04:35:42 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 664D1362E for ; Wed, 23 Sep 2020 08:35:42 +0000 (UTC) X-FDA: 77293667724.22.debt71_520b2f327155 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 43B2818038E60 for ; Wed, 23 Sep 2020 08:35:42 +0000 (UTC) X-HE-Tag: debt71_520b2f327155 X-Filterd-Recvd-Size: 2914 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 08:35:41 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600850140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oL9dJa7Sz+aBGSWtLYyw5EsG81JS/XSkUyZ/FO8DkAA=; b=OsaHPaORyW9iBB/mj5nSBWLewvOPpg75VZPhX+NMhAuf/r36GR3WUxykibBUNDGsGFbePk QuP9lKUxh2hBuFVQDgnEUElHBycyR2nAbWOR8tGZHvpoNhAy0x5w97GM83ypRaSOqc8tWP mtCNeMw7qI8KR+PhQFLc66C7TlowIIE= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ABBB7B226; Wed, 23 Sep 2020 08:36:17 +0000 (UTC) Date: Wed, 23 Sep 2020 10:35:34 +0200 From: Michal Hocko To: "Matthew Wilcox (Oracle)" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, hch@lst.de, Uladzislau Rezki Subject: Re: [PATCH 1/2] vmalloc: Free pages as a batch Message-ID: <20200923083534.GE4887@dhcp22.suse.cz> References: <20200921224628.20704-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200921224628.20704-1-willy@infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 21-09-20 23:46:27, Matthew Wilcox wrote: > Use release_pages() to free the pages allocated by vmalloc(). This is > slightly more efficient in terms of disabling and enabling IRQs once > per batch instead of once per page. Hmm, does this really lead to runtime improvements? Batching IRQ is certainly nice but release_pages is much more heavy weight and all additional checks are simply always false for vmalloc pages so all those checks are pointless. Maybe storing those pages into the linked list and use free_unref_page_list instead would achieve what you want? > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/vmalloc.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index be4724b916b3..3893fc8915c4 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -2263,16 +2263,8 @@ static void __vunmap(const void *addr, int deallocate_pages) > vm_remove_mappings(area, deallocate_pages); > > if (deallocate_pages) { > - int i; > - > - for (i = 0; i < area->nr_pages; i++) { > - struct page *page = area->pages[i]; > - > - BUG_ON(!page); > - __free_pages(page, 0); > - } > + release_pages(area->pages, area->nr_pages); > atomic_long_sub(area->nr_pages, &nr_vmalloc_pages); > - > kvfree(area->pages); > } > > -- > 2.28.0 -- Michal Hocko SUSE Labs