Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp177364imu; Thu, 6 Dec 2018 22:15:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/VJ+ETUg5ekyoRGkCCwx4TL9L5ddCjq2x0+UC0Z02C9WIEYHnmQFaH4w+zJV74XUvm+SA/V X-Received: by 2002:a62:868b:: with SMTP id x133mr1072578pfd.252.1544163352627; Thu, 06 Dec 2018 22:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544163352; cv=none; d=google.com; s=arc-20160816; b=AdLk024avkt0tIDhJK8Fhz0YZ/Rza+AgiZGVc+svk052S6iTqFzu3vXYG5I4fXcCCS 61/vwpHIBE5NY6qgIaUFFSk+FOHsAkSXe1504F+FY3qA9IySWJavxeIvJYCvwS7lrfhJ US73Jk7RFyiA6jnWsVXoiV71qg7A6dDI0uTBxMdSYr9h8bbieJzXV9P9xkEmnONL8XVq DTiR/GEY1s201dwOm7M3aQ7CCTZFjdnPNQ9z+0RaefoZlkKmOP4L9h6+G6kCyxvGJ1ER QivjRkL26J2c7YXe//F60c9hQJmNx2u5Ptyh4qLzMErpHXFdbQnx9ho8nzXc9B/abG5y x18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=fSZmNnQKUviuYpgyxOWRv5gsO7nJmlEpWJD2a+JAgy4=; b=mo9CPbeDDvWcZYBXHwlc43+ylRWfR3W6uiZPaYFmn4820AbsYl6WsVYtTpVuzQWPRy lbZLTpmKLYoqd0EQGkKRhO4rveHWXPpsa2o5xhYlDQRLt9ZGD1s2UYVqsNe+CsQZuCbY 0aGFZ3Jbx4U6wg5dQfo1OeGBO3NXl7Wz2Iod+CVPlzn5eDvm3jx4YxCcdhGfCkasp91C Ow+mdLpYyptoKQfbO/EKOvr1UK28bn8gQAG0vFshi+c/g242gQ2kNv1nKbJcUpBpmhVZ jrNYbkvtmdBGG1tlczfVo/SUZ2o9rGpEgMcK9QZAh8YWApJH9wihjTPfuQCwkoW174zk hqsQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si2276250pgr.67.2018.12.06.22.15.36; Thu, 06 Dec 2018 22:15:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbeLGGO3 (ORCPT + 99 others); Fri, 7 Dec 2018 01:14:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:55054 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbeLGGO2 (ORCPT ); Fri, 7 Dec 2018 01:14:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7CD73AE80; Fri, 7 Dec 2018 06:14:27 +0000 (UTC) Message-ID: <1544163250.3008.7.camel@suse.de> Subject: Re: [PATCH] mm, kmemleak: Little optimization while scanning From: Oscar Salvador To: Wei Yang Cc: akpm@linux-foundation.org, catalin.marinas@arm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@suse.com Date: Fri, 07 Dec 2018 07:14:10 +0100 In-Reply-To: <20181207041528.xs4xnw6vpsbu5csx@master> References: <20181206131918.25099-1-osalvador@suse.de> <20181207041528.xs4xnw6vpsbu5csx@master> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + > > This one maybe not necessary. Yeah, that is a remind of an include file I used for time measurement. I hope Andrew can drop that if this is taken. > > /* > > * Kmemleak configuration and common defines. > > */ > > @@ -1547,11 +1548,14 @@ static void kmemleak_scan(void) > > unsigned long pfn; > > > > for (pfn = start_pfn; pfn < end_pfn; pfn++) { > > - struct page *page; > > + struct page *page = > > pfn_to_online_page(pfn); > > + > > + if (!page) > > + continue; > > > > - if (!pfn_valid(pfn)) > > + /* only scan pages belonging to this node > > */ > > + if (page_to_nid(page) != i) > > continue; > > Not farmiliar with this situation. Is this often? Well, hard to tell how often that happens because that mostly depends on the Hardware in case of baremetal. Virtual systems can also have it though. > > > - page = pfn_to_page(pfn); > > /* only scan if page is in use */ > > if (page_count(page) == 0) > > continue; > > -- > > 2.13.7 > > -- Oscar Salvador SUSE L3