From patchwork Sun Apr 12 14:38:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Song X-Patchwork-Id: 11484583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C178313B2 for ; Sun, 12 Apr 2020 14:38:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84943206E5 for ; Sun, 12 Apr 2020 14:38:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=aliyun.com header.i=@aliyun.com header.b="CdAFRW2A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84943206E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=aliyun.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A8E0B8E00D1; Sun, 12 Apr 2020 10:38:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A3EBA8E00D0; Sun, 12 Apr 2020 10:38:31 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97C148E00D1; Sun, 12 Apr 2020 10:38:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id 7C0758E00D0 for ; Sun, 12 Apr 2020 10:38:31 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 414E9180AD801 for ; Sun, 12 Apr 2020 14:38:31 +0000 (UTC) X-FDA: 76699458822.13.stick03_2d23207f69d3a X-Spam-Summary: 2,0,0,0e1f13f0d03ec6c7,d41d8cd98f00b204,fishland@aliyun.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1261:1311:1314:1345:1437:1515:1534:1539:1711:1714:1730:1747:1777:1792:2196:2199:2393:2559:2562:2903:3138:3139:3140:3141:3142:3351:3865:3867:3871:3872:3874:4385:5007:6120:6261:6653:7576:8603:10004:11026:11658:11914:12048:12296:12297:12555:12679:12895:13069:13255:13311:13357:13894:14181:14384:14721:21080:21627:30054,0,RBL:115.124.30.52:@aliyun.com:.lbl8.mailshell.net-64.100.201.100 62.18.2.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: stick03_2d23207f69d3a X-Filterd-Recvd-Size: 2272 Received: from out30-52.freemail.mail.aliyun.com (out30-52.freemail.mail.aliyun.com [115.124.30.52]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Sun, 12 Apr 2020 14:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aliyun.com; s=s1024; t=1586702297; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=NAZarUO2huXtJsCY3KYJ16f8tY6pF62YZHPdMFOgZes=; b=CdAFRW2AVEuRdOeYxL/hSDSoN+zBwbl21/psvzuj0hfsoCDHKKyxs4ls1p6lHqGxLyR8ZunGk2PY7zWGKZzw9zOgixrQaPEJzVfjLjdwnYoJqrmhb+TTvYCH2mBuXFgJ9QMELROomqNX0l19k25cx4clRrTJ0kD+eYEV4IE4tvY= X-Alimail-AntiSpam: AC=CONTINUE;BC=0.2482544|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0536831-0.0019366-0.94438;FP=0|0|0|0|0|-1|-1|-1;HT=e01f04428;MF=fishland@aliyun.com;NM=1;PH=DS;RN=7;RT=7;SR=0;TI=SMTPD_---0TvHSo3z_1586702287; Received: from localhost.localdomain(mailfrom:fishland@aliyun.com fp:SMTPD_---0TvHSo3z_1586702287) by smtp.aliyun-inc.com(127.0.0.1); Sun, 12 Apr 2020 22:38:16 +0800 From: Liu Song To: gregkh@linuxfoundation.org, jroedel@suse.de, dave.hansen@linux.intel.com, tglx@linutronix.de Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, liu.song11@zte.com.cn Subject: [RFC PATCH] mm/vmalloc: make sure to traverse from the beginning when overflow occur Date: Sun, 12 Apr 2020 22:38:03 +0800 Message-Id: <20200412143803.43931-1-fishland@aliyun.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.011824, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Liu Song If overflow, should ensure that "free_vmap_cache" is set to NULL, so as to ensure that it can be traversed from the beginning. Signed-off-by: Liu Song --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index d8e877365f9f..2638a20d36ce 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -441,7 +441,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, if (!free_vmap_cache || size < cached_hole_size || vstart < cached_vstart || - align < cached_align) { + align < cached_align || purged) { nocache: cached_hole_size = 0; free_vmap_cache = NULL;