Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp320663imu; Fri, 7 Dec 2018 01:28:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XV1x99sTK1qXYAMHsueFlXJS3abbSot1ued9dMROndCQXieNA8Ow+SkF6LtAePOCkXN4mX X-Received: by 2002:a17:902:8c98:: with SMTP id t24mr1443686plo.130.1544174896889; Fri, 07 Dec 2018 01:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544174896; cv=none; d=google.com; s=arc-20160816; b=HpD2Ci2MiTr6Yss09Q99kZXO0oliEMY4+skzmkJaXDbAybQYmUt4Q38RdB+DRG1XfJ W/JUndaKCUEKwFZ02zc6vt5BFPv0A77Hp6WxTOvhmWnjnH+LpbHtjex0P+uP1/uh6abn dVkBqZS9A5fS4Nd622wWpJx2SvsMGSj630MOefGeIdf1faBwJ1R/Vij7Bi4xcfikaQZC 09pbZk63/aHMV4qSGEnRfdJnfZ1Q0FphYz9VdQnu7KSa2oUDCDoZJAS26+q/B+H5zb0/ iOdQb/fuq5HeWg0C/N7VCmMQqTIVGvPhcP03xhehs4LJydjM366M0+l8oBqqnBfZvpGz oN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=EXuIkNCq3bJVuoZPevNt7bNuW5dFAHJpQGXSc1UTOQM=; b=SbSBugQyzg0zeOVC7bkSxWx7hD++5nU/raYOxPZzsnqeo38vyTyL2KvOe/+ZLON/u6 tglsk5oYglitbw9ea571BVR6L+uNhUzYpRL41kPk6F9uVsQMMnLoJzZj8BUshtF/kRJv Jb92/jvJnQu98C+/oq0H2JPuUkdK495mdbpPOJtRYnbTRi+oLQki8EtqPKWriGVjVjwW s0dmp0ADepuCepobudPZSXF7XOqNLTNrb8lFzZ6Z3pCLUartqIoULmTWnWbRcHikon5F cyX9E9IVdiUOFZXHiBhEyvFZZI1O9kFFAyIJeDFG83cNDgERWKhVKO21KC7hftZSk2NF AWig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b5S9d4Mo; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si2352894pgd.461.2018.12.07.01.28.01; Fri, 07 Dec 2018 01:28:16 -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=@gmail.com header.s=20161025 header.b=b5S9d4Mo; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726008AbeLGJ0t (ORCPT + 99 others); Fri, 7 Dec 2018 04:26:49 -0500 Received: from mail-ed1-f48.google.com ([209.85.208.48]:35932 "EHLO mail-ed1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbeLGJ0t (ORCPT ); Fri, 7 Dec 2018 04:26:49 -0500 Received: by mail-ed1-f48.google.com with SMTP id f23so3155089edb.3 for ; Fri, 07 Dec 2018 01:26:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EXuIkNCq3bJVuoZPevNt7bNuW5dFAHJpQGXSc1UTOQM=; b=b5S9d4MoHbSw1GWIvewSvJBTk6gcx5tAqOxPEWM05a37x5t4C6xbGqDqegnKCMHRkl KOh0F8l7yrs2SSUa04ENdiXbcoYeaENgtfSH03WnAWs7q/8iMd57g98LainQW8jxIRHj Agyk6dYkrGZ312XMpkjm5gGxxPoD/JA3kIbMZIbME22NMVc41q9iGG7QqweHxAi7itHA lXEk+eijHYthqUMrXepW8ozvDQqVP/WFTPd8z/968bOIkl/j331UPCxiJOQhlsgaRPRq uQziIbfJs4n3KoQ0KxBsBiUn0qYEkOiSU/VBu5f7jdj2cpunD+22zw5hrYI7uOUjVyBo Nuwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EXuIkNCq3bJVuoZPevNt7bNuW5dFAHJpQGXSc1UTOQM=; b=WNFyu1lvfHZRrFiJ9Nblo7cGFVJFoji84HU0MU2PyA0+Hzpwc1Decg9kfH9t7lSGcB oEjmB5SQQh29DzWzwMnMk2FUd5dL+ubF1Wq2SGalDTZQR5hQEeaQ0zLHD+ifGxy099s+ /K58lV/rTySm7UVX4cvtrrt3tCK7T1yUjHTMTGzVTMY0gDk+t9CdFOuJXVENSDJS5wCw MIUizJkO2o45lP5CXzuGli2ekPTSfFssMf8z5DNaqbGTXGJiZf55sYnPxdGDXL4tLOX7 ZuwqWUrbETbaF1OrOjiDk4R7rGtg/TXjhTkC2iFPiD3mPWHSsFecWnJQHwfclawNG+pj y6gA== X-Gm-Message-State: AA+aEWY/9HJtPgsascq7bXmXJUPKjUYYUOaId5hNOklDUAjqmj8Q4bmP GBpHDTqAEiZYRe8bD28tG1M= X-Received: by 2002:a17:906:3ce9:: with SMTP id d9-v6mr1406379ejh.236.1544174807646; Fri, 07 Dec 2018 01:26:47 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a13sm786137edt.83.2018.12.07.01.26.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 01:26:47 -0800 (PST) Date: Fri, 7 Dec 2018 09:26:46 +0000 From: Wei Yang To: Oscar Salvador Cc: Wei Yang , akpm@linux-foundation.org, catalin.marinas@arm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@suse.com Subject: Re: [PATCH] mm, kmemleak: Little optimization while scanning Message-ID: <20181207092646.zygzfrdnqcq6xvqm@master> Reply-To: Wei Yang References: <20181206131918.25099-1-osalvador@suse.de> <20181207041528.xs4xnw6vpsbu5csx@master> <1544163250.3008.7.camel@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544163250.3008.7.camel@suse.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 07, 2018 at 07:14:10AM +0100, Oscar Salvador wrote: > >> > + >> >> 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. > Ok, generally looks good to me. Reviewed-by: Wei Yang >> >> > - 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 -- Wei Yang Help you, Help me