From patchwork Wed Feb 19 23:36:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mina Almasry X-Patchwork-Id: 11392797 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 7EA9D139A for ; Wed, 19 Feb 2020 23:36:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 44982207FD for ; Wed, 19 Feb 2020 23:36:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ElaWK+vv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44982207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 671F86B0005; Wed, 19 Feb 2020 18:36:20 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5F9E36B0006; Wed, 19 Feb 2020 18:36:20 -0500 (EST) 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 50EE26B0007; Wed, 19 Feb 2020 18:36:20 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id 380856B0005 for ; Wed, 19 Feb 2020 18:36:20 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E6872181AEF15 for ; Wed, 19 Feb 2020 23:36:19 +0000 (UTC) X-FDA: 76508487678.08.brake00_373994f8e6903 X-Spam-Summary: 30,2,0,4b18e69dec0d9524,d41d8cd98f00b204,3csznxgskcc8lwxldcjxtylrzzrwp.nzxwtyfi-xxvglnv.zcr@flex--almasrymina.bounces.google.com,:almasrymina@google.com:rientjes@google.com:mike.kravetz@oracle.com:shakeelb@google.com:akpm@linux-foundation.org::linux-kernel@vger.kernel.org,RULES_HIT:41:69:152:355:379:387:541:800:960:968:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1535:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2902:3138:3139:3140:3141:3142:3152:3354:3865:3867:3868:3870:3871:3872:3874:4605:5007:6119:6261:6653:7875:7903:9592:9969:10010:10400:11026:11232:11473:11658:11914:12043:12296:12297:12438:12555:12679:12683:12895:13846:14096:14097:14181:14394:14659:14721:21444:21451:21627:21740:21939:21990:30012:30054:30056:30064:30090,0,RBL:209.85.210.202:@flex--almasrymina.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Cu stom_rul X-HE-Tag: brake00_373994f8e6903 X-Filterd-Recvd-Size: 5521 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 23:36:19 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id z19so1245404pfn.18 for ; Wed, 19 Feb 2020 15:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:cc; bh=ceCTx418aVihpo6rFpR+wNvTWdymckdQCgW+S+5D+ww=; b=ElaWK+vvjlEOTaDI96uhD4FifQudUv5N04GNPFXTKz4pnHeBBMuR5FVqNefTmSeoKL q6ud/on58vD3yWdnaZA0L6ny6hgVYQDrMuxVwBbKaxSe/hQGwhNU3VYqY5PoVeeAsHoO 2fK+CMjVgvXJMRJhFiR1Pu9J53gtOYIBwxNZ20PiXSNCVK1vg3yITTnp5EpMKhUIIay7 5Hp5PIzqXLuliehS1AIBGHEb5+nG+jXk+8eyyz6SPd0fk6OtaFld3H+Af3DSN+MOaB85 1C26Q1AFY/pTY5N1NXnEGvLq89tvNgUaYX3YTyo/pC5fa8U2JN8J+Eqfd9L22jBO4u7C gMIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:cc; bh=ceCTx418aVihpo6rFpR+wNvTWdymckdQCgW+S+5D+ww=; b=kyhWrtZmN48brv4824jMX8qKTnKD+6oic0kP02cBefaUlRs5wnK8KN62tN21BqqFvV HaDYVd4ZnFicXRoXQbR9ejAaGFYU9VdB93tOlcVPaqixhs84B4SEYVxaLOO6RXBf1Mfs /CpWpd0gMuVPN8z+hsTAV4WiJCQKhw3OaWBZWmWPfC2fV6yK3N4kE2on80pZ1V4spRzn S+s12sQYnTo7M27gVoAPoQuWZgQbl8TtK7qh+D3823E40NlHc+9D/aV2Qa7td5oRUz3c 0U2AGzY3CGjp1SeqZjoAvROMWLPSYCh8xsNvbsShSTBoAOXLozGZRdei6pErRlgvjSB5 YWAg== X-Gm-Message-State: APjAAAWLBaAhfCf2Ww8+tn5k7XK0KCC9ersg9w6ephiVA9Wh2CGfS3UT ISCtNZok0rLslABIx7ke8LfDP8wzvHk/SrOTqg== X-Google-Smtp-Source: APXvYqyzpCXqcYecDcsReRHjemmx0QG/s7nd43ULuYIdIDb+B3vjF0F8F9JOP1Puk6SS10PJSvGwUosPzYzTCfp5fA== X-Received: by 2002:a63:48d:: with SMTP id 135mr30192787pge.350.1582155378171; Wed, 19 Feb 2020 15:36:18 -0800 (PST) Date: Wed, 19 Feb 2020 15:36:10 -0800 In-Reply-To: Message-Id: <20200219233610.13808-1-almasrymina@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH] hugetlb: Remove check_coalesce_bug debug code From: Mina Almasry Cc: Mina Almasry , David Rientjes , Mike Kravetz , Shakeel Butt , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.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: Commit b5f16a533ce8a ("hugetlb: support file_region coalescing again") made changes to the resv_map code which are hard to test, it so added debug code guarded by CONFIG_DEBUG_VM which conducts an expensive operation that loops over the resv_map and checks it for errors. Unfortunately, some distros have CONFIG_DEBUG_VM on in their default kernels, and we don't want this debug code behind CONFIG_DEBUG_VM and called each time a file region is added. This patch removes this debug code. I may look into making it a test or leave it for my local testing. Signed-off-by: Mina Almasry Cc: David Rientjes Cc: Mike Kravetz Cc: Shakeel Butt Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Fixes: b5f16a533ce8a ("hugetlb: support file_region coalescing again") Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) -- 2.25.0.265.gbab2e86ba0-goog diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 94e27dfec0435..3febbbda3dc2b 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -289,48 +289,6 @@ static bool has_same_uncharge_info(struct file_region *rg, #endif } -#if defined(CONFIG_DEBUG_VM) && defined(CONFIG_CGROUP_HUGETLB) -static void dump_resv_map(struct resv_map *resv) -{ - struct list_head *head = &resv->regions; - struct file_region *rg = NULL; - - pr_err("--------- start print resv_map ---------\n"); - list_for_each_entry(rg, head, link) { - pr_err("rg->from=%ld, rg->to=%ld, rg->reservation_counter=%px, rg->css=%px\n", - rg->from, rg->to, rg->reservation_counter, rg->css); - } - pr_err("--------- end print resv_map ---------\n"); -} - -/* Debug function to loop over the resv_map and make sure that coalescing is - * working. - */ -static void check_coalesce_bug(struct resv_map *resv) -{ - struct list_head *head = &resv->regions; - struct file_region *rg = NULL, *nrg = NULL; - - list_for_each_entry(rg, head, link) { - nrg = list_next_entry(rg, link); - - if (&nrg->link == head) - break; - - if (nrg->reservation_counter && nrg->from == rg->to && - nrg->reservation_counter == rg->reservation_counter && - nrg->css == rg->css) { - dump_resv_map(resv); - VM_BUG_ON(true); - } - } -} -#else -static void check_coalesce_bug(struct resv_map *resv) -{ -} -#endif - static void coalesce_file_region(struct resv_map *resv, struct file_region *rg) { struct file_region *nrg = NULL, *prg = NULL; @@ -435,7 +393,6 @@ static long add_reservation_in_range(struct resv_map *resv, long f, long t, } VM_BUG_ON(add < 0); - check_coalesce_bug(resv); return add; }