Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp527411lqo; Wed, 8 May 2024 07:13:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzgmub46TUJzz77cWqw9+aEQIWOW3AVLfpxPt0FLZzAA4J+CIFepjYwQflvvPtrVvBZavighMk1bf4AkGUtPMsVPq5M3ZiSiIgQB94RA== X-Google-Smtp-Source: AGHT+IF3+68heaO+C2Zhea7bfnxZ6j8c83w0GfaBPVFq3Q6oxRoeA8DiyotjDSuM8prEvptl21y9 X-Received: by 2002:a05:6102:366:b0:47c:dd:2cd2 with SMTP id ada2fe7eead31-47f2b8faaebmr4376044137.1.1715177635251; Wed, 08 May 2024 07:13:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715177635; cv=pass; d=google.com; s=arc-20160816; b=fXiZ8/7qaIovpgEv8/dCqhZ+s6w25AjA8iNt+XJLMsCJa9Dil/sh6tpi5gcMWtrmKf SgSW2vp2xzwqD86x1LqbrIngC7CioVImFZ7AE0ltDH/BzF4NwNLwjj2tg1HvygN5fkEw MX0ypUURJZJEphigoX70lB9p5hZMo1vlLSCLJ/akR2ZdfgjQBhN+pqVEz8KQDbBzBKlD 583l3qgUg0BLqyKs5FtPoHgXstxShpb6Xtu/R1SvkHU/VFC5UrTm1h9pIWqgQZ99gYLr aemBoU7djVXecg3oqVVgX3zDPymWpPr+QqIkeyQWkooubk+waOd94Qa/4blydm6HUzE/ MMRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=TfbSiMaoKWe2Hf6m9L+WRZhC/TYEwUM1p2i1xR65WtE=; fh=r/HpMa4x8BuGVQzOYV4w2XCuove9S8Ut9h8WwHUZuc4=; b=RE46Bm6swT/RTTPvXCg33IdQut4BUXg9AseGKM1BBU7Hj9KL7UwT/nzpinUch2Mx7q xXSOZF7sCvAWCKAXZYLEHHmLZv4lqh/bOXIEwPDK72q/yHkTel0ZXdol5Rwcq02XiYXk KXM0Z9Ov4pkQAZ64Z+61H0USW/NcIfz+Y844dkg5pj01+UaKoXN56Pl8wB+GUDepxPjb oHflLDTdFOMEZPh4XF72K/r/1oUD/Iq5t4nhmaiBIh5emGvBqNlEyTT5JVHeFmPP3VFg aRhmxgNUzc4Dwn3hQyvzT6OaIbuGzvyGVAHiBv9Y/QkQO4V/pXcnxqaZQfmsGDv8IhtA wHWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b="B/H8Btgk"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-173387-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q15-20020a056130028f00b007f0450b6979si2594473uac.21.2024.05.08.07.13.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 07:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173387-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b="B/H8Btgk"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-173387-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F0CEA1C20F50 for ; Wed, 8 May 2024 14:13:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1709585620; Wed, 8 May 2024 14:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="B/H8Btgk" Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6511984FC4 for ; Wed, 8 May 2024 14:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715177627; cv=none; b=GFoDcHXrqxHp9Wcx6MrqD3Y5IQ0Dg0AghrLEI5oBdAxoEoYos6aaNE0pGtTA862v8pDFu3LCVGCgWwxBXDAdwTGYryoQZaFdRG0SI+3Eo46S1Ds3sw9iXGXc9LAt7uHBu1dadAnjTsDXj1mJ+mcNrQyNNfOicJCehfoIK6rO5cU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715177627; c=relaxed/simple; bh=rrwlIaYZbtV52TlODyJZHB6ZbMr+R9trpJlCJpTFGak=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=if8sf+owkbf2AJj96D1dhjv9QbWjPw/DcXs51Q7cQZy1Y/JWOp49ON79kD1kATAOjQCGzSItzitTQ1AIa24BeSz8T24O3Fb72UZ9S/mjK0L1AclxtvbBI0MRTe5B0j7fQbWLXkFxLHfh3lJvCsKUbOu7xPSUhik1jq09v/GFXWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=B/H8Btgk; arc=none smtp.client-ip=115.124.30.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1715177621; h=Message-ID:Date:MIME-Version:Subject:From:To:Content-Type; bh=TfbSiMaoKWe2Hf6m9L+WRZhC/TYEwUM1p2i1xR65WtE=; b=B/H8Btgk3tuUJUIFGkATsMqTQp4XZs13weeLg0EacyS+I4JV8rlNd2iMauC0QVaGCgRDOY9a7A1+tfGjENxJx3xjsihWnUXtOsai/e4Rm/VLjd74TJkSLuNXXh483CaHfq3nloc7wSecepErY+4AzPKlQTtVaTop8xIYzTozvnc= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067111;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0W63uUr3_1715177617; Received: from 30.27.69.8(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W63uUr3_1715177617) by smtp.aliyun-inc.com; Wed, 08 May 2024 22:13:40 +0800 Message-ID: <35ab69e7-97cf-4409-b73f-05b00e110ed7@linux.alibaba.com> Date: Wed, 8 May 2024 22:13:37 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] mm/vmalloc: fix vmalloc which may return null if called with __GFP_NOFAIL From: Gao Xiang To: hailong.liu@oppo.com, akpm@linux-foundation.org, Michal Hocko Cc: urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, 21cnbao@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xiang@kernel.org, chao@kernel.org, Oven References: <20240508125808.28882-1-hailong.liu@oppo.com> <404add29-2d3f-45db-9103-0c5b66fb254e@linux.alibaba.com> In-Reply-To: <404add29-2d3f-45db-9103-0c5b66fb254e@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/5/8 21:41, Gao Xiang wrote: > > +Cc Michal, > > On 2024/5/8 20:58, hailong.liu@oppo.com wrote: >> From: "Hailong.Liu" >> >> Commit a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc") >> includes support for __GFP_NOFAIL, but it presents a conflict with >> commit dd544141b9eb ("vmalloc: back off when the current task is >> OOM-killed"). A possible scenario is as belows: >> >> process-a >> kvcalloc(n, m, GFP_KERNEL | __GFP_NOFAIL) >>      __vmalloc_node_range() >>     __vmalloc_area_node() >>         vm_area_alloc_pages() >>              --> oom-killer send SIGKILL to process-a >>              if (fatal_signal_pending(current)) break; >> --> return NULL; >> >> to fix this, do not check fatal_signal_pending() in vm_area_alloc_pages() >> if __GFP_NOFAIL set. >> >> Reported-by: Oven >> Signed-off-by: Hailong.Liu > > Why taging this as RFC here?  It seems a corner-case fix of > commit a421ef303008 BTW, I guess maybe commit e9c3cda4d86e ("mm, vmalloc: fix high order __GFP_NOFAIL allocations") misses fatal_signal_pending() handling anyway.. > > Thanks, > Gao Xiang >