Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp21780ybv; Wed, 19 Feb 2020 15:36:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyaI0+QVeWMp/ekSG2XE+ce0vCJY37EqPNqh/WTIoQuUsCB/Y/8O0QgMGB8sOABUknuBYAg X-Received: by 2002:aca:b808:: with SMTP id i8mr126737oif.66.1582155408517; Wed, 19 Feb 2020 15:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582155408; cv=none; d=google.com; s=arc-20160816; b=ouTJ7xEyOh2zOoJ8KB9Nh8eWsLXDHuB22MSL0UB70ZRcczcfjizub120UvDgxEO/kA kcof+HjKcC/X54HFayHtbRJWtIMDJFD3JhQdGfL0NrAEShyFsz3qCH3n4qfoMuRqN1jF 2RWvVS3hDq7PT+2PyracA8j1Kmca+rJCDHsivkVO/y0JxV3vh9Ou9V4MZbWLGaXR92BD zYYNejGNxHIihQ/+uX3Za/1olR4moQfS6UuZxC5y3LzDQ82ZD6cLD83TBMaksXV2LL2D 37ZSYPZy9wTfFA/SiWY4ViMCLseXq7jkI062bEdh0+ajQIoEBYj4dQu6JHLrB8+CFnQD D7rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=ceCTx418aVihpo6rFpR+wNvTWdymckdQCgW+S+5D+ww=; b=O33qtVgtYqlqxdzpywGNuluUtIm/Z8XKm9QWqVT7Ez57A+f+tRP0qR1pexnTnolF0M CDs6L4h8AbvlvedJFaxH4jwk+qDp9WjIDM9YYB8gJeXyn3V9+CRnXiy/3P2/Z80+IVGA UOWhTAAgqm/s/yCdxaWMNIBACNqdKWKPbJoj+eFO1iIbRIdRFX4M4NUlvF/V6DngrddW NWH8045xKBhPucgoDzg3NNLceXsZtYr5mDb0oWfRsj+82F2FMq0XYffXqd/6yVW4xaIP NgkHgjQ1i2UHsWZFoCa57zE3STJjM6wnsrNHV/c+LuhgKaxn2YjSrS40Ly0wJcygsxpX 6wrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ElaWK+vv; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x84si10266225oia.27.2020.02.19.15.36.33; Wed, 19 Feb 2020 15:36:48 -0800 (PST) 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=pass header.i=@google.com header.s=20161025 header.b=ElaWK+vv; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgBSXgT (ORCPT + 99 others); Wed, 19 Feb 2020 18:36:19 -0500 Received: from mail-pl1-f201.google.com ([209.85.214.201]:56598 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726680AbgBSXgT (ORCPT ); Wed, 19 Feb 2020 18:36:19 -0500 Received: by mail-pl1-f201.google.com with SMTP id 91so1101281plf.23 for ; Wed, 19 Feb 2020 15:36:18 -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=hTGebh1vza05P8ToDV1fjq4heJ/a1gUc/N5fwpH9MyOsCtR0Ik8AFthRppjsQremCY tzBShBXqF3rU+sjkmkBHnIwBv61Li76R5MtSYuQ4tJVmFZQntCHUyhRpiuiqBHvB14Kr woLGqk9lq/jtQ/uHZyH0pqyhFeXWHSshura50uK+WW6bE8yyosXlpG1bB7FBpo+GKcrN IZddRW302guicYJojHI5UE60OkaHGKwXNP/MuHTRlYjbuCaYLOAZ2hsJ4+bH/vjgUliY d0bHrYutehZJq214p4M3/6rFenKudpOJVArl0DKAmWCU3FMNePLvZrNytretjsUTXK9P R7mw== X-Gm-Message-State: APjAAAXTGcsU//t3I0vS41S3pnMXpUErPl8/Hqc7/4rbQDF4Z3JrCNjM uIWY6yNg4oeMSn0gOAgtmE4WqkQT6R9QxxVcLA== 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 Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") --- mm/hugetlb.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) 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; } -- 2.25.0.265.gbab2e86ba0-goog