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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 34F16C433ED for ; Sun, 9 May 2021 19:47:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C788F613B6 for ; Sun, 9 May 2021 19:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C788F613B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 61BA36B0073; Sun, 9 May 2021 15:47:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F3166B0074; Sun, 9 May 2021 15:47:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 493EB6B0075; Sun, 9 May 2021 15:47:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 2D7546B0073 for ; Sun, 9 May 2021 15:47:38 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E055B99AE for ; Sun, 9 May 2021 19:47:37 +0000 (UTC) X-FDA: 78122727354.13.A0762AD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id C81BAE00011A for ; Sun, 9 May 2021 19:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=m3qKaE/dAAtd9qSEfx7CFC7FcoGRyDQMt5A8LQjD2Q4=; b=vNbaXLHh3DOxM3jJaJM8IPKm7X fzRlZNDS6xgR9xru48M+QhuNWoOO5lqtIXBMIcQYlpdFlysG6BQpmdG7JIGYXuOV+IQun1e3lL9Cq wwxyKnmVcDvKwuY+0mGPi9bsio8tYUs6NzjZHr1WCCWlKo+s1LWFnR3vo/TcjbtoeWU+oV8D94TB7 ouY3ckmGTP9YE8Q+OArQ/gm1dVmOMVrGnCo5LjM+DLfyeq1A00ArvMb2GLLZPaUW0RS2o534NhABz ms5U1X7bt+1pKfO4H1jI2dZR2EbB+Qe+6uOp6C4GHu3xu15Vw7Cq7/7676g+n5m53pYogu1b/xwGk L0GSQTDg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lfpOS-005NoZ-37; Sun, 09 May 2021 19:47:14 +0000 Date: Sun, 9 May 2021 20:47:12 +0100 From: Matthew Wilcox To: "Uladzislau Rezki (Sony)" Cc: Andrew Morton , linux-mm@kvack.org, LKML , Nicholas Piggin , Mel Gorman , Hillf Danton , Michal Hocko , Oleksiy Avramchenko , Steven Rostedt Subject: Re: [PATCH v2 2/2] mm/vmalloc: Print a warning message first on failure Message-ID: References: <20210509193844.2562-1-urezki@gmail.com> <20210509193844.2562-2-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210509193844.2562-2-urezki@gmail.com> Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=vNbaXLHh; dmarc=none; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C81BAE00011A X-Stat-Signature: uz9excgjt44hjan33i56nz9c4sah7zdk Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620589652-923638 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 Sun, May 09, 2021 at 09:38:44PM +0200, Uladzislau Rezki (Sony) wrote: > export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ > - -O2 -fomit-frame-pointer -std=gnu89 > + -O0 -g -fomit-frame-pointer -std=gnu89 You clearly didn't intend to submit this portion ... > +++ b/mm/vmalloc.c > @@ -2781,11 +2781,11 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, > } > > if (!area->pages) { > - free_vm_area(area); > warn_alloc(gfp_mask, NULL, > "vmalloc size %lu allocation failure: " > "page array size %lu allocation failed", > nr_small_pages * PAGE_SIZE, array_size); > + free_vm_area(area); > return NULL; > } I think this is a bad idea. We're clearly low on memory (a memory allocation just failed). We should free the memory we have allocated to improve the chances of the warning message making it out.