Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5247607rwb; Mon, 21 Nov 2022 19:27:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf6G5N/6j6PGw5qug3Z3avbVwDDWscRQ1GlE21S9MadsM1ICGUa7cPT+WtdjxBbgkv5nbCMx X-Received: by 2002:a17:906:455:b0:7ad:b97e:283a with SMTP id e21-20020a170906045500b007adb97e283amr17354816eja.567.1669087619846; Mon, 21 Nov 2022 19:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669087619; cv=none; d=google.com; s=arc-20160816; b=FF9L9EReGToMYcz3uVLCQCt67WG4KfZs8UhvR7huWasM2vKR+CbOm8sGNe0s8g1h33 N1hAW26azN3M0p48ET6v6OIdXCO6TpV3QS/aDoQMG3eCabCX1odyoIWq8NkbFq5E1DZE y81tyuZ4vP+g6UvASMpWsx1vmRwXgkM1YsL/QgNyerbH0QEu8uaExs/WQmGu+2DlsZ1I WIDLhguGrd4sup5HOaJFmCuH5zrfwPhyE1FlhMh8f1oxUdA3iQy9DTXyeeeVbd/0PAEq WsU/gpzIho3QFhbIA9gvwZASrhhd9S7caw3btyKxer5CKLYq7MOPzHLmkdM3Wh/1Zo3l W6Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0CiyjDdTfauQUln/S8JKlz3FnBrq1FeGqO43v3NL0cI=; b=GGrtMRk0hyUG3wO/bl1PXOuZ1IRRFIeSTK+LSmiM403XFkQ+RP7D68VbyE/ELpNErc NZ0Q4n7dzwcZPcE1JwcolYzMYT1KNVBCdEIpanf25xArGBxQ/vwF8v7zK70KcrAqgRK9 sNRHbAfOQ+0uqrlHlwGHhXyksscUsXDDZoTmrrWZ0FqydFzA7vhpbUpuFzPOmGAnwdcr g0Corp5jMOQI3r7oPrbpDnOjfsqxWuKbqIC1qWDoqhFIU2RQT5idSWy4S5Dd5B3kQ+/K CyPioxwLqlUAfAv0ol+E0HcgiqAYsQHIWM/bIEDtofvEN8v6gOM6jFC5EwNSgrDxkcGN 75IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=cyuE3iOB; 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=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a05640210cd00b0046272b487cesi8697500edu.331.2022.11.21.19.26.35; Mon, 21 Nov 2022 19:26:59 -0800 (PST) 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=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=cyuE3iOB; 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=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbiKVDQG (ORCPT + 92 others); Mon, 21 Nov 2022 22:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbiKVDQF (ORCPT ); Mon, 21 Nov 2022 22:16:05 -0500 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FBDD1FCD4 for ; Mon, 21 Nov 2022 19:16:04 -0800 (PST) Received: by mail-qv1-xf2f.google.com with SMTP id j6so9315153qvn.12 for ; Mon, 21 Nov 2022 19:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0CiyjDdTfauQUln/S8JKlz3FnBrq1FeGqO43v3NL0cI=; b=cyuE3iOBx0NFRc//xsPoso6mtBj6Dgo8Fe/NMGakYHCImhgWQUbZhVoubfovqm6G+h CDWydrrIb5+El7DyyxkxXVRmL3OkQKvrbZZt7t3EN9BXnE8ijpngmBxL+uUeFUdT56m3 1fuEGfXMkMfAGAbAkJHCVXoUl35/jOrG5CyqwfDIE2Do0z8d+IL5Gal1MSbxua7DdP7C e40nfakVcSK7De/dX+J3RsP6XlDsb0AH2NtHrmnNyVmxIbZ/3roUow3DjGwg6iJq0gZn ucmNOfzdjViIEad+0Hb6Kca8QO5G8Vkx2TftaZcDUPMCsg5rHLt2I3zTOj+uVGGapsTS iNSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0CiyjDdTfauQUln/S8JKlz3FnBrq1FeGqO43v3NL0cI=; b=ly3NMXbI+zv3novPQXKGitL89OS4d/MMjM5KXwf+qg48IhxrRZBPDqSIG9E72/qU7e EgsYgN59Nx9zulQ3HlRkjRIsEoUfaEnHxJbqaUVzSlIrVnojHnAaV1uoA0cBhP9aSzej tQgUR0mvJbdlDSBZ7R63hi32w3Uz7tnqW0Jgxc8y33XjrSza8IenzRzVk+Q1ycj2VNIw dJ/M+D9oZwSYN7J01V7k0kn8UYZ5IvJZuaMhzKUgYix0hM3cu178/UB3dkEG0oTiWSUg cNW0mfvQQCPWcKhUQrdtsFuW678R+MkhQzP4eI9AXjSEJ+VVHR9mXUiguClhgFwCMVQC qKVA== X-Gm-Message-State: ANoB5pkDe/JI6iaChP+/4UFFy/eh8K1AILFL0biYR2Y1de47fv7HjAn+ Q31ZROkyeyI1IB7+0RqINFFD1w== X-Received: by 2002:a05:6214:162e:b0:4c6:57f1:3514 with SMTP id e14-20020a056214162e00b004c657f13514mr3635896qvw.87.1669086963553; Mon, 21 Nov 2022 19:16:03 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:bc4]) by smtp.gmail.com with ESMTPSA id dt44-20020a05620a47ac00b006fbf88667bcsm3616176qkb.77.2022.11.21.19.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 19:16:03 -0800 (PST) Date: Mon, 21 Nov 2022 22:16:28 -0500 From: Johannes Weiner To: Sergey Senozhatsky Cc: Andrew Morton , Seth Jennings , Dan Streetman , Vitaly Wool , Nhat Pham , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] zswap: do not allocate from atomic pool Message-ID: References: <20221122013338.3696079-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221122013338.3696079-1-senozhatsky@chromium.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Tue, Nov 22, 2022 at 10:33:38AM +0900, Sergey Senozhatsky wrote: > zswap_frontswap_load() should be called from preemptible > context (we even call mutex_lock() there) and it does not > look like we need to do GFP_ATOMIC allocaion for temp > buffer there. Use GFP_KERNEL instead. > > Signed-off-by: Sergey Senozhatsky > --- > mm/zswap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index 2d69c1d678fe..f6c89049cf70 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -1314,7 +1314,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset, > } > > if (!zpool_can_sleep_mapped(entry->pool->zpool)) { > - tmp = kmalloc(entry->length, GFP_ATOMIC); > + tmp = kmalloc(entry->length, GFP_KERNEL); There is another one in zswap_writeback_entry() that seems equally arbitrary. They came in through the same commit, with no further explanation as to this choice. Do you want to pick that up too?