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=-20.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,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 8402CC4338F for ; Mon, 23 Aug 2021 12:14:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2B1106137F for ; Mon, 23 Aug 2021 12:14:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2B1106137F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 92F46900002; Mon, 23 Aug 2021 08:14:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B8036B0072; Mon, 23 Aug 2021 08:14:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73348900002; Mon, 23 Aug 2021 08:14:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 567256B006C for ; Mon, 23 Aug 2021 08:14:24 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F1BA88249980 for ; Mon, 23 Aug 2021 12:14:23 +0000 (UTC) X-FDA: 78506238006.26.D63E088 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 97B5F50219C8 for ; Mon, 23 Aug 2021 12:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629720863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WEjMQGX1KeHQQA6Fe8o+7SRlCmyC/TIhEiJOh7GRbZM=; b=GnB76PkdGpr0OHFDgM26y4NFVo6i6mlvY9QqXD2gcswRHV1e0x2Zyj2qY73v0rD9svY2tz q0RYZwjs/hMCckrCgplc/LEaB8k3DJbC3QIHbBb9ROWmG3+rk9JAyMbqcg/r9N+O/ByFY/ 63de8as8TGVzjFzqYmIxwmm0Y6k9YGs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-571-QYaWPMgrNqmH2C8mvrDDWQ-1; Mon, 23 Aug 2021 08:14:21 -0400 X-MC-Unique: QYaWPMgrNqmH2C8mvrDDWQ-1 Received: by mail-wm1-f72.google.com with SMTP id i204-20020a1c22d5000000b002e74466ad9bso2525142wmi.4 for ; Mon, 23 Aug 2021 05:14:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=WEjMQGX1KeHQQA6Fe8o+7SRlCmyC/TIhEiJOh7GRbZM=; b=oQfQaELWlcvNn2m4hg5A3kX/257VYQmED1CmencdPyPKCwy6lg48xhmlznfcyGWbvA 7/gxq8zgCKk+lLnNDbRBAElwbaxxMj8ZET0CvGw17D+jLXTSq5d9VGPlbvP7L8MM4bNm 0Ow13UC92orqLlh8wL4kMkWbzaDQXnmpxp6z7IIAhwqC3sEQy8V/nrdHlPvy7g+MdfUn ujbRdngfRVKBhjZc5tL+rRIyxb0KKpk2uNZQ7noiKZPmSxKccaINdmK23fQtgxOVng1p q4+1sjclRcQRAW/2qySgv4bmDtiVhXpu8wSE8E8u0F3fxWyTVXxwwfuxEgHHfx1Gl5S7 2CNw== X-Gm-Message-State: AOAM531KRz3huT3HGR2uX3yB7+HJ3TtsKZ7hAWeXl/inwjSMUbLUjOde Ur3AegNUJz/MQEEbSjEQ9BwiQTxVhpFMJyzz1EIzhxs9nLO/at7fgRU7nO/PkLF06vPXwQeKqZ+ OlZe/dNBNTqo= X-Received: by 2002:a1c:4cd:: with SMTP id 196mr3108868wme.10.1629720860616; Mon, 23 Aug 2021 05:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykF11071BQXfbt/Dl9bGIDAF3TpneD8dS1A2Y1BfOFYHYb40BEohvshrBi+sgGfxgS3p+kqQ== X-Received: by 2002:a1c:4cd:: with SMTP id 196mr3108831wme.10.1629720860376; Mon, 23 Aug 2021 05:14:20 -0700 (PDT) Received: from ?IPv6:2003:d8:2f0a:7f00:fad7:3bc9:69d:31f? (p200300d82f0a7f00fad73bc9069d031f.dip0.t-ipconnect.de. [2003:d8:2f0a:7f00:fad7:3bc9:69d:31f]) by smtp.gmail.com with ESMTPSA id 129sm13099311wmz.26.2021.08.23.05.14.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Aug 2021 05:14:20 -0700 (PDT) Subject: Re: [PATCH 1/3] mm/memory_hotplug: use helper zone_is_zone_device() to simplify the code To: Miaohe Lin , akpm@linux-foundation.org Cc: naoya.horiguchi@nec.com, mhocko@suse.com, minchan@kernel.org, cgoldswo@codeaurora.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210821094246.10149-1-linmiaohe@huawei.com> <20210821094246.10149-2-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat Message-ID: <31b111bd-82e6-7cb1-3bd4-590ff2963a83@redhat.com> Date: Mon, 23 Aug 2021 14:14:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210821094246.10149-2-linmiaohe@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 97B5F50219C8 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GnB76Pkd; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf01.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam01 X-Stat-Signature: 7gkcx1oxufzp6k3piphk4pw6hz7e6hsr X-HE-Tag: 1629720863-306328 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 21.08.21 11:42, Miaohe Lin wrote: > Use helper zone_is_zone_device() to simplify the code and remove some > explicit CONFIG_ZONE_DEVICE codes. > > Signed-off-by: Miaohe Lin > --- > mm/memory_hotplug.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index b287ff3d7229..d986d3791986 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -477,15 +477,13 @@ void __ref remove_pfn_range_from_zone(struct zone *zone, > sizeof(struct page) * cur_nr_pages); > } > > -#ifdef CONFIG_ZONE_DEVICE > /* > * Zone shrinking code cannot properly deal with ZONE_DEVICE. So > * we will not try to shrink the zones - which is okay as > * set_zone_contiguous() cannot deal with ZONE_DEVICE either way. > */ > - if (zone_idx(zone) == ZONE_DEVICE) > + if (zone_is_zone_device(zone)) > return; > -#endif > > clear_zone_contiguous(zone); > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb