Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1631883iob; Thu, 19 May 2022 10:39:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe+tJBS0xWATq/ijZZ1R/PHQ6QzJL1i5m2UTXAC7uQf3VTF6Pqk5C90Xu2Omf0uu0oMbzM X-Received: by 2002:a17:90b:1b03:b0:1dc:9dc9:2eec with SMTP id nu3-20020a17090b1b0300b001dc9dc92eecmr6335464pjb.37.1652981948058; Thu, 19 May 2022 10:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652981948; cv=none; d=google.com; s=arc-20160816; b=z8Kz3Xhny96h+ouiJRBqtOM8HUfvUY/69DG8jbO85piWF6VgCCOpy1xFF6fr0RYjZF pC4LauDAiS/hmAPerf6NKiO39jvqRg2XB/KA4z5NsWUMJOZtWyyNjdQlmyM+DPywu+IY WQVKidi0bMPKF9XG1wfMpMvVQ4/sDKhMTJQIlAKk+BWZXFDKk8SFGUliCPpVfQfxi9Ji PRLCUqqzX8ahxOVJMJAiuiUaBKRMt+taI+syqb7y+QKMt9F70SRB5d72CXTu97lPQkQ5 BO8oi5YqVSb0ILXgAmo55E2pYMxBGiXP9t/77C8XgJVJb7L0slFm3jMKTfRJw5WJDJDR 3Ucg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=t084sKzrzbE4Z4sLi5GYD8Kcw0NI6XaXk1rNnLtIud4=; b=0UDs5oQYWH7jOXRmdDa7adyNukKOBln9ZMbOUj1iQ5eFVf/iyueJUOyVnPzum4rmvf bGhZKjjCXFbp19jT3pS8P+S94Y++HiEV5sLPbOz5q+lqdQGnzSPUiYdcPuuAw/KMO3zD OnyuWESP+aaYQsEgFqLN5OXqWa/w3uBP+gIvjogUDjZDp0wnbKoGobgXGmyCa3ROK4z8 3GMtYKpVUjhi5/Mnkr7Ie2DlQANAlFv4YRejNt7Qjsv3s39uZHuGWgEEz/Vyj8ShnRJB x52XjvRNlzo3jlCrJepcnjyStysfJowzlmkhqdfrBsDCzKYpb1imuWc6BrHWt7VOEiJX gT/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 124-20020a630482000000b003f5f9e173c2si7320621pge.504.2022.05.19.10.38.55; Thu, 19 May 2022 10:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232705AbiESLeN (ORCPT + 99 others); Thu, 19 May 2022 07:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237473AbiESLeH (ORCPT ); Thu, 19 May 2022 07:34:07 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5472B41CB for ; Thu, 19 May 2022 04:34:03 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L3nlW3JTrz1JCKN; Thu, 19 May 2022 19:32:39 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 19:34:01 +0800 Subject: Re: [PATCH 5/9] revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc" To: Vitaly Wool CC: Andrew Morton , Linux-MM , LKML References: <20220429064051.61552-1-linmiaohe@huawei.com> <20220429064051.61552-6-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: Date: Thu, 19 May 2022 19:34:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/19 15:12, Vitaly Wool wrote: > On Fri, Apr 29, 2022 at 8:41 AM Miaohe Lin wrote: >> >> Revert commit f1549cb5ab2b ("mm/z3fold.c: allow __GFP_HIGHMEM in >> z3fold_alloc"). >> >> z3fold can't support GFP_HIGHMEM page now. page_address is used >> directly at all places. Moreover, z3fold_header is on per cpu >> unbuddied list which could be access anytime. So we should rid >> the support of GFP_HIGHMEM allocation for z3fold. > > Could you please clarify how kmem_cache is affected here? With this code changes, kmem_cache should be unaffected. HIGHMEM is still not supported for kmem_cache just like before but caller ensures __GFP_HIGHMEM is not passed in now. The issue I want to fix here is that if z3fold page is allocated from highmem, page_address can't be used directly. Did I answer your question? Or don't I get your point? Thanks! > > Thanks, > Vitaly Many thanks for your time! :) > >> Signed-off-by: Miaohe Lin >> --- >> mm/z3fold.c | 8 +++----- >> 1 file changed, 3 insertions(+), 5 deletions(-) >> >> diff --git a/mm/z3fold.c b/mm/z3fold.c >> index b3b4e65c107f..5f5d5f1556be 100644 >> --- a/mm/z3fold.c >> +++ b/mm/z3fold.c >> @@ -212,10 +212,8 @@ static int size_to_chunks(size_t size) >> static inline struct z3fold_buddy_slots *alloc_slots(struct z3fold_pool *pool, >> gfp_t gfp) >> { >> - struct z3fold_buddy_slots *slots; >> - >> - slots = kmem_cache_zalloc(pool->c_handle, >> - (gfp & ~(__GFP_HIGHMEM | __GFP_MOVABLE))); >> + struct z3fold_buddy_slots *slots = kmem_cache_zalloc(pool->c_handle, >> + gfp); >> >> if (slots) { >> /* It will be freed separately in free_handle(). */ >> @@ -1075,7 +1073,7 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp, >> enum buddy bud; >> bool can_sleep = gfpflags_allow_blocking(gfp); >> >> - if (!size) >> + if (!size || (gfp & __GFP_HIGHMEM)) >> return -EINVAL; >> >> if (size > PAGE_SIZE) >> -- >> 2.23.0 >> > . >