From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94A0EC4727E for ; Fri, 25 Sep 2020 09:49:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F2289208A9 for ; Fri, 25 Sep 2020 09:49:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2289208A9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1F5FF6B005C; Fri, 25 Sep 2020 05:49:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A7616B005D; Fri, 25 Sep 2020 05:49:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0952E6B0062; Fri, 25 Sep 2020 05:49:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id E511F6B005C for ; Fri, 25 Sep 2020 05:49:21 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9E5F18249980 for ; Fri, 25 Sep 2020 09:49:21 +0000 (UTC) X-FDA: 77301110922.28.key31_420a68b27166 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 7D59010F9B for ; Fri, 25 Sep 2020 09:49:21 +0000 (UTC) X-HE-Tag: key31_420a68b27166 X-Filterd-Recvd-Size: 2783 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Fri, 25 Sep 2020 09:49:20 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BBFB1B1AE; Fri, 25 Sep 2020 09:49:19 +0000 (UTC) Date: Fri, 25 Sep 2020 11:49:16 +0200 From: Oscar Salvador To: Anshuman Khandual Cc: linux-mm@kvack.org, Daniel Jordan , Zi Yan , John Hubbard , Mike Kravetz , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [RFC] mm/vmstat: Add events for HugeTLB migration Message-ID: <20200925094912.GA31664@linux> References: <1601025149-13311-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1601025149-13311-1-git-send-email-anshuman.khandual@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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: On Fri, Sep 25, 2020 at 02:42:29PM +0530, Anshuman Khandual wrote: > Add following new vmstat events which will track HugeTLB page migration. > > 1. HUGETLB_MIGRATION_SUCCESS > 2. HUGETLB_MIGRATION_FAILURE > > It follows the existing semantics to accommodate HugeTLB subpages in total > page migration statistics. While here, this updates current trace event > "mm_migrate_pages" to accommodate now available HugeTLB based statistics. > > Cc: Daniel Jordan > Cc: Zi Yan > Cc: John Hubbard > Cc: Mike Kravetz > Cc: Andrew Morton > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual Was this inspired by some usecase/debugging or just to follow THP's example? > int retry = 1; > int thp_retry = 1; > + int hugetlb_retry = 1; > int nr_failed = 0; > int nr_succeeded = 0; > int nr_thp_succeeded = 0; > int nr_thp_failed = 0; > int nr_thp_split = 0; > + int nr_hugetlb_succeeded = 0; > + int nr_hugetlb_failed = 0; > int pass = 0; > bool is_thp = false; > + bool is_hugetlb = false; > struct page *page; > struct page *page2; > int swapwrite = current->flags & PF_SWAPWRITE; > @@ -1433,6 +1437,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, > for (pass = 0; pass < 10 && (retry || thp_retry); pass++) { Should you not have put hugetlb_retry within the loop as well? Otherwise we might not rety for hugetlb pages now? -- Oscar Salvador SUSE L3