Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp347635ybt; Fri, 26 Jun 2020 00:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh7yDK6P+PmYpOlxy8YlEQ/mZgZ3eAGcVWEEW0+5y7+3isxN+b0BMeW/8zQ08NG1UUGhOJ X-Received: by 2002:a50:8465:: with SMTP id 92mr1975251edp.388.1593156878014; Fri, 26 Jun 2020 00:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593156878; cv=none; d=google.com; s=arc-20160816; b=Ha2yTRJHur8t6QxwoenkRPeHcT32+J72JVuPVkj4WoJiUli4jqd61R3CH1/Y4WhR0m V2KAL7AyWR6qwbKW8vfsc/LjtOmoGRxcSsOuG8TkTLBRu3MGxQ66NNQzPmh8kI+SNlhM ppm7NdPcGIhJcaFIbXoZhaSGN+17rmdogo4t8kfajiq8LLi9bwqBIlzqFvzZHtIUtuC9 lyMuEBbVkDUdRl/yLXRvyDvbHtAniljcXlgvXylCRanargQKyHfuHeVDjy1N3XuUIYky kmF3SaQIqGAgtBqnvimUupNK9afunBMHWp4o3oo5kYqpSdzxKRV6iH4cSCZiQ8+4lhaD PPMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0BsORbavqGPY3g2MRQ6uJFdI1egNxjb5jhEOHzC1dZo=; b=MgakrpcLE/4iLsOqe1iewjZJ098HzTfbNt5nlfOI3KcPoHbAjdNtqFXAIwxwA7VKvL coOuwzgrlDF56RxC4WW3sEN+iFuiF7PuvMcYkbfkTmAc/8aAwvoKSXFnf7PH6FSZp2Ll YbZrdDl4rbqD2cn1Lhi3Ewk+e3AqyIaNOYqsHUL7Nzyl3u5kiBAhthBSE1AL8DFLbGY4 YPE1JCHW+7kI0olBA3uEXDGuaZBrN130R3/Z0vCp4aifLCv7Ij9/6GBz3Bm7vjPxL+A2 i5LMbghlh0SRwwIkOTbRol8xAIUyOZzB4Som6g5OAKvCpePY2LrZw/eM1ca4XviWzF+h MZRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc22si16250381ejb.655.2020.06.26.00.34.14; Fri, 26 Jun 2020 00:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728701AbgFZHdr (ORCPT + 99 others); Fri, 26 Jun 2020 03:33:47 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43369 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbgFZHdq (ORCPT ); Fri, 26 Jun 2020 03:33:46 -0400 Received: by mail-wr1-f68.google.com with SMTP id j4so5991749wrp.10 for ; Fri, 26 Jun 2020 00:33:45 -0700 (PDT) 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=0BsORbavqGPY3g2MRQ6uJFdI1egNxjb5jhEOHzC1dZo=; b=hSiyKt+501QPEyjRqy6rjLmnjRQVbgiIUVIucCS9ND0VHNGTkNav+ar0gsV99coCeX ivxGMCnoI8IWAZydAYKAuxx9IK144arcwUi6FQuBzE3qXy8rLvkyo0FN7mdtp8pt4c56 3kGzOotz7NTRMIKOkfw8m+efRTOvuOaTyLmNfRd/qm/y70yvxNY6S42hSfh5bKcLo2Ra BsvRszmbZl3Pjb3c8f8aD9vHh3IBHFL0QM6CVe2d4kte+dmkVtx1gpIbys4k9u+RwZed C8NvSmVu9Nx9KUsGaK+QkOemp1fmv4rCgSId/6KDBwICZs3g/KGVRNhoMqUHTFQ6k003 /Qiw== X-Gm-Message-State: AOAM532d0lZJKGXBM1htDi6w9Rd/TbGsty9ia0q5Eq6pzY5AKQygq4Db G3wUgTlZN4c3KzXYQ/gNqVc= X-Received: by 2002:a5d:610a:: with SMTP id v10mr2263115wrt.108.1593156825019; Fri, 26 Jun 2020 00:33:45 -0700 (PDT) Received: from localhost (ip-37-188-168-3.eurotel.cz. [37.188.168.3]) by smtp.gmail.com with ESMTPSA id d13sm20607853wrn.61.2020.06.26.00.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 00:33:44 -0700 (PDT) Date: Fri, 26 Jun 2020 09:33:42 +0200 From: Michal Hocko To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Joonsoo Kim Subject: Re: [PATCH v3 5/8] mm/migrate: make a standard migration target allocation function Message-ID: <20200626073342.GU1320@dhcp22.suse.cz> References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-6-git-send-email-iamjoonsoo.kim@lge.com> <20200625120550.GF1320@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 26-06-20 14:02:49, Joonsoo Kim wrote: > 2020년 6월 25일 (목) 오후 9:05, Michal Hocko 님이 작성: > > > > On Tue 23-06-20 15:13:45, Joonsoo Kim wrote: [...] > > > -struct page *new_page_nodemask(struct page *page, > > > - int preferred_nid, nodemask_t *nodemask) > > > +struct page *alloc_migration_target(struct page *page, unsigned long private) > > > { > > > - gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL; > > > + struct migration_target_control *mtc; > > > + gfp_t gfp_mask; > > > unsigned int order = 0; > > > struct page *new_page = NULL; > > > + int zidx; > > > + > > > + mtc = (struct migration_target_control *)private; > > > + gfp_mask = mtc->gfp_mask; > > > > > > if (PageHuge(page)) { > > > return alloc_huge_page_nodemask( > > > - page_hstate(compound_head(page)), > > > - preferred_nid, nodemask, 0, false); > > > + page_hstate(compound_head(page)), mtc->nid, > > > + mtc->nmask, gfp_mask, false); > > > } > > > > > > if (PageTransHuge(page)) { > > > + gfp_mask &= ~__GFP_RECLAIM; > > > > What's up with this gfp_mask modification? > > THP page allocation uses a standard gfp masks, GFP_TRANSHUGE_LIGHT and > GFP_TRANHUGE. __GFP_RECLAIM flags is a big part of this standard mask design. > So, I clear it here so as not to disrupt the THP gfp mask. Why this wasn't really needed before? I guess I must be missing something here. This patch should be mostly mechanical convergence of existing migration callbacks but this change adds a new behavior AFAICS. It would effectively drop __GFP_RETRY_MAYFAIL and __GFP_KSWAPD_RECLAIM from the mask so the allocation would "lighter". If that is your intention then this should be a separate patch with an explanation rather than hiding it into this patch. -- Michal Hocko SUSE Labs