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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A1DDCC433DB for ; Mon, 1 Feb 2021 11:49:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 208E664E06 for ; Mon, 1 Feb 2021 11:49:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 208E664E06 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8AC9F6B0070; Mon, 1 Feb 2021 06:49:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 836D06B0071; Mon, 1 Feb 2021 06:49:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FE146B0072; Mon, 1 Feb 2021 06:49:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 52D5D6B0070 for ; Mon, 1 Feb 2021 06:49:51 -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 17BCB181AEF15 for ; Mon, 1 Feb 2021 11:49:51 +0000 (UTC) X-FDA: 77769529782.08.tax38_5a02c0f275c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id E6FA91819E785 for ; Mon, 1 Feb 2021 11:49:50 +0000 (UTC) X-HE-Tag: tax38_5a02c0f275c2 X-Filterd-Recvd-Size: 5136 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 11:49:50 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1612180188; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NFnrMJIQEE2ourhyO+GKx2F39xv/yVWuIZUE5mKeW+I=; b=IMq1SAd6dx+bVBYZCNiF9zAdI1LdLLtBebxw15V/F+f2UvUafy6fWfnnH7k0S5LM2PRpl+ kC8iLryKlvjX3YiE5CPdnPeswErWS3eIvCZcytUK4MCnR+8ui2haYc2RjVDdKLRc7nJhMw QJbR9Xhe7kqPq8dDrgWIY2lN+UERkwo= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CEB47AD29; Mon, 1 Feb 2021 11:49:48 +0000 (UTC) Date: Mon, 1 Feb 2021 12:49:47 +0100 From: Michal Hocko To: Mike Kravetz Cc: Andrew Morton , Oscar Salvador , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Naoya Horiguchi , Muchun Song , David Hildenbrand , Matthew Wilcox , Miaohe Lin Subject: Re: [PATCH v3 3/5] hugetlb: only set HPageMigratable for migratable hstates Message-ID: References: <20210122195231.324857-1-mike.kravetz@oracle.com> <20210122195231.324857-4-mike.kravetz@oracle.com> <20210127103523.GI827@dhcp22.suse.cz> <2196d93e-f573-7163-183e-0ad2cec7555e@oracle.com> <20210128055221.GA3166@localhost.localdomain> <20210128133733.ce1fb2eac98ab5696c08f288@linux-foundation.org> <12187293-e972-acd8-7789-22ebfa736f95@oracle.com> <20210128141531.17fec31e6075fe0eb6e33683@linux-foundation.org> <62a80585-2a73-10cc-4a2d-5721540d4ad2@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62a80585-2a73-10cc-4a2d-5721540d4ad2@oracle.com> 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 29-01-21 10:46:15, Mike Kravetz wrote: > On 1/28/21 2:15 PM, Andrew Morton wrote: > > On Thu, 28 Jan 2021 14:00:29 -0800 Mike Kravetz wrote: > >> > >> Michal suggested that comments describing synchronization be added for each > >> flag. Since I did 'one patch per flag', that would be an update to each patch. > >> Or, I could simply add a patch to update the comment block based on what you > >> already have. > >> > >> Let me know what is best/easiest for you. > > > > I guess just one patch is best for reviewers. Then I'll split up into > > a sprinkle of -fix patches if I'm feeling energetic ;) > > Here is a patch to update the comments for all those flags. It should > apply on top of what is in your tree. > > From: Mike Kravetz > Date: Fri, 29 Jan 2021 10:36:12 -0800 > Subject: [PATCH] huegtlb: add synchronization information for new hugetlb > specific flags > > Adding comments, no functional change. > > Signed-off-by: Mike Kravetz Acked-by: Michal Hocko Thanks Mike! > --- > include/linux/hugetlb.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index e5e6ffd55392..cf70795d2209 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -480,14 +480,24 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, > * HPG_restore_reserve - Set when a hugetlb page consumes a reservation at > * allocation time. Cleared when page is fully instantiated. Free > * routine checks flag to restore a reservation on error paths. > + * Synchronization: Examined or modified by code that knows it has > + * the only reference to page. i.e. After allocation but before use > + * or when the page is being freed. > * HPG_migratable - Set after a newly allocated page is added to the page > * cache and/or page tables. Indicates the page is a candidate for > * migration. > + * Synchronization: Initially set after new page allocation with no > + * locking. When examined and modified during migration processing > + * (isolate, migrate, putback) the hugetlb_lock is held. > * HPG_temporary - - Set on a page that is temporarily allocated from the buddy > * allocator. Typically used for migration target pages when no pages > * are available in the pool. The hugetlb free page path will > * immediately free pages with this flag set to the buddy allocator. > + * Synchronization: Can be set after huge page allocation from buddy when > + * code knows it has only reference. All other examinations and > + * modifications require hugetlb_lock. > * HPG_freed - Set when page is on the free lists. > + * Synchronization: hugetlb_lock held for examination and modification. > */ > enum hugetlb_page_flags { > HPG_restore_reserve = 0, > -- > 2.29.2 > -- Michal Hocko SUSE Labs