Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp50194ioo; Fri, 20 May 2022 13:39:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOyAB2LRjUbsdBKIULIkSH9FbdvK43nTUrTloe8irjUE+/HTWu+iQZxPMA79Ge+qxY2rdD X-Received: by 2002:a17:90a:940d:b0:1df:359b:2f9e with SMTP id r13-20020a17090a940d00b001df359b2f9emr13147488pjo.235.1653079167675; Fri, 20 May 2022 13:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653079167; cv=none; d=google.com; s=arc-20160816; b=bxsR8SeVeSHhNXlikYHdIALNL98VsNBKASE7ErqPhlFof4GZv5XU8KiqqNXHUw/HNv DCsea/QJ1Yyyck8hWIevGHDWU6YtGJjueiEUUv0LoxtYP5qJ2hfmaGHCaGVTwWyn2JTt dx4hz1FSkvoHttVO4tuN0oP9pu4Xl6Ub/CpxXv1Pzn3NENrtNFns9fq5lOyu42oabNQr lsVcfqSBXhGqfOFBuuK/Dl/Y1XTJ0r+WKPue0NJqAQeLxUj+NaJeIqljHEgVOsnTgZJ6 KRWGD5y/+oTcvaK1S3KogaSdnAh7azNQbEXQfK5PpkBBhihVXL3ik3nX5WMCfVZby9jP AIWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0Q69dDAg2sPbdhTNPQU98bpOR6SJW5uFikEJxhg9Ty8=; b=fTaKKJZmKDYZ9Sq/B6xyzCO+OLq9Fz3sldqUoM3PfjHzY9/U1VXjNg1PwnSJB+/LlR AwRO2IzochBjXMlqOnfH0X90R/9aLXTQOdQOosOlPl8Tl2j5gQQazU/a+oPGHlaCuUw7 y9pvbwuQ8xRstYLohBaZdRbRy3uVwpO22ziNyAp82rP/21Bdg/yrhULjnMf4KcgvpPNn 6tK5ag7vXHfhXh9wd3kqc2P1Wu5jLrX8qis6UuF0Cjeh6N6XXECnw5IHt0r2XBbjQUzz Grm9xPQoXSuDW8m6B3rK3A91KYKOh5JcCEKexh3ySLGR3VPTUKEw2rTKm74MG5vH1YNV SSJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=qV2NUoxu; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a62e916000000b0050d5fed6283si3875700pfh.161.2022.05.20.13.39.16; Fri, 20 May 2022 13:39:27 -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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=qV2NUoxu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240974AbiESSbX (ORCPT + 99 others); Thu, 19 May 2022 14:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244191AbiESSbP (ORCPT ); Thu, 19 May 2022 14:31:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DCFADD7 for ; Thu, 19 May 2022 11:31:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B9A2561AB8 for ; Thu, 19 May 2022 18:31:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 056F7C385AA; Thu, 19 May 2022 18:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652985073; bh=Ta58ypg7C5RBl1jeQLPbuw2Br2B3B7e2eFsbiZbyb/c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qV2NUoxuWXcRHtsTtE16jglBzLifEm1hc82saNbVjqE8zFxJuONumCqs8vg5m2aaJ 6klJ4udHdL5wK0gzPhbOh+uRNKv7zUNgmNFoegFBC4rceAwr7DNJvpEhWf4kxGh5+E 1/uUVWSEhk1Pn8d6qMQu56EOncp3uAhclZc01FzA= Date: Thu, 19 May 2022 11:31:12 -0700 From: Andrew Morton To: Miaohe Lin Cc: Vitaly Wool , Linux-MM , LKML Subject: Re: [PATCH 5/9] revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc" Message-Id: <20220519113112.7531614a96dc4852ba61fdbc@linux-foundation.org> In-Reply-To: References: <20220429064051.61552-1-linmiaohe@huawei.com> <20220429064051.61552-6-linmiaohe@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, 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 Thu, 19 May 2022 19:34:01 +0800 Miaohe Lin wrote: > 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? > Yes, page_address() against a highmem page only works if that page has been mapped into pagetables with kmap() or kmap_atomic(), and z3fold doesn't appear to do that. Given that other zpool_driver implementations do appear to support highmem pages, I expect that z3fold should be taught likewise. I didn't look very hard, but this particular patch is a bit worrisome. As I understand it, zswap can enable highmem: if (zpool_malloc_support_movable(entry->pool->zpool)) gfp |= __GFP_HIGHMEM | __GFP_MOVABLE; and z3fold will silently ignore the __GFP_HIGHMEM, which is OK. But with this patch, z3fold will now return -EINVAL, so existing setups will start failing?