Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1423555rda; Mon, 23 Oct 2023 12:06:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyeEJJYVv0q9E5c5cnBgStZyEk4PnPMJJNQrEyE8YfGLOY5TmwZMAoK2UraoU66Vu7sk2v X-Received: by 2002:a17:902:f7cd:b0:1ca:86a9:cace with SMTP id h13-20020a170902f7cd00b001ca86a9cacemr7645973plw.2.1698087981454; Mon, 23 Oct 2023 12:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698087981; cv=none; d=google.com; s=arc-20160816; b=xaTNYRGZKVNNbr/k/eB8WzS8wtJyOzUaXYcKATKbSqxujptYT5qRRzXzSgNwi5Q0/e GMBhamyocGwmp12fypTlQ1F5lBRT1h4q03puajuJbCo82H72xh0mwzhmUY75U7TwZhkv 6N4IGVrdZAV8eDmREgPUcKxpq/cykytZWjJSrvw9fwGalT2A3eQnbnq6ivJxckQng6Ge BYOyy0XRAUGblkNpZpgUfQMBEkXu5dS2IUvPc7fKXIgcMMFxJtCxi0iABICZD0dCMswN Rp4G8si1UrzW8aCCeMyI02kC+j8rI43eUpxkwYX1eIIzs4BS5zB9Y8k/RSlR8ANKWEz4 UFJQ== 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=FJT4jfY3CvkrAsPNDoMHVpWpbleU6NBvUL9f6Zwuc+E=; fh=K3nTi/1kb+wLkBuprFByq9dfKRY00hbJ0isQ8A7gckY=; b=K0YdIZ6Bu9L7jklBhAjvqZys0a44G/O/lxVx9Tun46AZhpC/VzdTR6IfK1Ytf57a5e GNaFfN8Y/0KL+6Wo7xIYBWtmDbR8/3rUyBD9YuC6ZU15qMijJvzPDbbczpAmR1qT7Ibj UhKfmiq89JP/POrqczVD1rJCDTyy8jLTPc7n0JVLOK55dBOBmtkXYhiq5ggzeOyy9+Bq 3fv0/tBqD8LSizWny9Qgn1upOiTgFnk7lGqk6i6S2YVSvZ58bvOXyPV79ekd3u/BPyg4 /TYJk1Wq1XTfXaMGzoWXdlkBXIwKFEeGRr+iv9B+afNjoiLx+yyUjM80FUkjTpcEPEnn xDow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=HbpFXpmn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u8-20020a170902b28800b001caac2f7aa0si6530521plr.27.2023.10.23.12.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=HbpFXpmn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 08F0F8032A30; Mon, 23 Oct 2023 12:06:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjJWTGD (ORCPT + 99 others); Mon, 23 Oct 2023 15:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjJWTGA (ORCPT ); Mon, 23 Oct 2023 15:06:00 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FABB94 for ; Mon, 23 Oct 2023 12:05:57 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-581b6b93bd1so2184983eaf.1 for ; Mon, 23 Oct 2023 12:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1698087956; x=1698692756; darn=vger.kernel.org; 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=FJT4jfY3CvkrAsPNDoMHVpWpbleU6NBvUL9f6Zwuc+E=; b=HbpFXpmnwTrFEEXGKmuN5wdo6IYeCvhSdQrFB1yPszSpJC6xC9ADU1toxTvjlCe61L 0djEWOAxtrtsgrfnI7I4Fkld1Ibdaq5bhLD08WwFhSLYoppMKo6Q4Yy/TJr+iArQhley RlU4wGAfiw96oqWN6UT3HPHirtz9/XSElfLRPWhV0x0Fd0Tl99k4GKWJHjA+VugdnUDV D3Rh28VzrTUxBeBVTS4n6pWJYhJU4mDko4fsEhnuYzlJ1XhYs3W6iURyJZCXKyAmZYEL 8MimEPUlkNtrg+2JOva3WHZ8Ko0lveKMTp/eye+yX6uum62cYxoLiLFsxgIbYc85/dHu MCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698087956; x=1698692756; 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=FJT4jfY3CvkrAsPNDoMHVpWpbleU6NBvUL9f6Zwuc+E=; b=texmW2aFODGJgo6lHityDiwE3kIg6LfwlPiJM3mnsGEGyMIym4750G332OJJ3CmSRB HT8h+Y9c7K1Z7fX83k5nVMxY1jMsz/dKc2GwE9lvjDq51ejXgvJ6tEui/OokLYS454K3 wXKLLUArz42J9CqUsoN7Oa42MlKxCcMDiLVy4abtb5j8fj44pi9FIU29tqcq3Md/A9kx cMFhElVppxf3P6yMyHfU8nUDeYoR4SVSxq3F6VNxSWq+qJp2Unqc4+4OXq0Nt8dH6miq ruH5VQo92L+Aee2EFlO/1wJR2dRU9+QYPmAhqtkpQH9C3KNUECdaVN+3z7gpg8ANgJHs XSKg== X-Gm-Message-State: AOJu0YzHVrzvgx8QE62QNy/jy+Fia9B5rYUgksUf0VDcwudKk/zqXhsM L96ov+vWi3y2zjeUXJ7s9RFn6A== X-Received: by 2002:a05:6359:1a44:b0:168:d1ba:e3c8 with SMTP id ru4-20020a0563591a4400b00168d1bae3c8mr6159850rwb.19.1698087956589; Mon, 23 Oct 2023 12:05:56 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:f369]) by smtp.gmail.com with ESMTPSA id jy12-20020a0562142b4c00b0065823d20381sm3074118qvb.8.2023.10.23.12.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:05:56 -0700 (PDT) Date: Mon, 23 Oct 2023 15:05:55 -0400 From: Johannes Weiner To: domenico cerasuolo Cc: Andrew Morton , Hugh Dickins , Andi Kleen , Christoph Lameter , Matthew Wilcox , Mike Kravetz , David Hildenbrand , Suren Baghdasaryan , Yang Shi , Sidhartha Kumar , Vishal Moola , Kefeng Wang , Greg Kroah-Hartman , Tejun Heo , Mel Gorman , Michal Hocko , "Huang, Ying" , Nhat Pham , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 10/12] mempolicy: alloc_pages_mpol() for NUMA policy without vma Message-ID: <20231023190555.GA1964810@cmpxchg.org> References: <74e34633-6060-f5e3-aee-7040d43f2e93@google.com> <1738368e-bac0-fd11-ed7f-b87142a939fe@google.com> <20231023105331.311373ed33a0dfe78ddaa9e5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:06:19 -0700 (PDT) On Mon, Oct 23, 2023 at 08:10:32PM +0200, domenico cerasuolo wrote: > Il giorno lun 23 ott 2023 alle ore 19:53 Andrew Morton > ha scritto: > > > > On Mon, 23 Oct 2023 18:53:26 +0200 domenico cerasuolo wrote: > > > > > > Rebased to mm.git's current mm-stable, to resolve with removal of > > > > vma_policy() from include/linux/mempolicy.h, and temporary omission > > > > of Nhat's ZSWAP mods from mm/swap_state.c: no other changes. > > > > > > Hi Hugh, > > > > > > not sure if it's the rebase, but I don't see an update to > > > __read_swap_cache_async invocation in zswap.c at line 1078. Shouldn't we pass a > > > mempolicy there too? > > > > No change needed. zswap_writeback_entry() was passing a NULL for arg > > `vma' and it's now passing a NULL for arg `mpol'. > > Problem is that alloc_pages_mpol is dereferencing mpol, when I test the zswap > writeback at 397148729f21edcf700ecb2a01749dbce955d09e it crashes, not sure if > I'm missing something. I don't think you are. The NULL vma used to go to get_vma_policy(), which fell back to pol = get_task_policy(current); Now the NULL pol gets passed to alloc_pages_mpol() directly, which dereferences it. Oops. I think Hugh's patch needs zswap to pass get_task_policy(current) instead of NULL.