Message ID | 20240830202823.21478-1-21cnbao@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7156CA1013 for <linux-mm@archiver.kernel.org>; Fri, 30 Aug 2024 20:29:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 821836B0259; Fri, 30 Aug 2024 16:29:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D0FE6B025A; Fri, 30 Aug 2024 16:29:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69A306B025B; Fri, 30 Aug 2024 16:29:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3C2BE6B0259 for <linux-mm@kvack.org>; Fri, 30 Aug 2024 16:29:16 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CEC4C8057D for <linux-mm@kvack.org>; Fri, 30 Aug 2024 20:29:15 +0000 (UTC) X-FDA: 82510051470.05.3867F5C Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf28.hostedemail.com (Postfix) with ESMTP id 0048FC0017 for <linux-mm@kvack.org>; Fri, 30 Aug 2024 20:29:13 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fUuSyLuw; spf=pass (imf28.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725049682; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=fEPWr/xekCDmqr18XIc3NMTS/mqkekh8L9HwJ1zsDOs=; b=uYYrQNJCMhREpU//N5HYLSdMCEK3PccqfNYlPbCoDHX7Jo4VL8mpw+Y2PAhBehobJMoFFg Cj3Pr9ek42Xisu67zK3RxFFG375dTBfEZY6mwBIf4cory+Yc1jiEknPz5GbbxatdKMshnN sUeWHddL+vXUuDLXA2Wy+TWHwMCT6tY= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fUuSyLuw; spf=pass (imf28.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725049682; a=rsa-sha256; cv=none; b=XCUz7hrbc7Zy6s67HAhDHXB4/KlayBx1n+c/FeXXlOQ+TgT8+naPhQsqhhljJh4PHleelw h4ipiLouno1nHreAVL5Q7VcilQ3VwxgAh+ZaQsyRiCwSL3Wjk++vPd+qWZ6yL8bXRriUK6 L28TQNGoofga22LW2CFlyasOtU2EVMw= Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-715cdc7a153so1717325b3a.0 for <linux-mm@kvack.org>; Fri, 30 Aug 2024 13:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725049752; x=1725654552; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fEPWr/xekCDmqr18XIc3NMTS/mqkekh8L9HwJ1zsDOs=; b=fUuSyLuwdQeLgD8x0Rj7BLIVLWO0wNcR++j69pSf4D3+FFLlM8E88a9G07QxCW5wp+ yFJoIM3VrTkcUFwNHZjZxvi2xWUZaxmAvVoMRzxvO0IrvUk/6FIH2IDKCqSSKcPlUKQw Vxr4jDc5L1uOUNJQtWvpKWtAMn04AANQnbFHAWyzYBHTq5XlZnNlrOXk4kkrrtbAjZi8 3Z6T+NWzouuBX+z0fsShlbunjyMIhK3cXvnTrkyu2Mim8FPxjZMgUXTh3FZ7RZ8V2t54 GDAiSL1QYeloIv/A732yXS3NAfoxKJnxmlaxtgxkfkMSqoBaO9NG+8W2auUXkkdwJWeW N7Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725049752; x=1725654552; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fEPWr/xekCDmqr18XIc3NMTS/mqkekh8L9HwJ1zsDOs=; b=f6xe6FMXtA6L/3HT7hJRzMDeUBQwq0bO8fz+d/nWItR/Bm9c4lNO0GciUPcmSTxUm2 URRPtEX07rlx6iYlejxHCFo+RbanPxDRMpVkc6AJr68+B5fPb0soQUsxyIOs3PjkAsvn qYF0eHjHUtgFCCTSJ6JGVIdXGAHCRcHrcohgttODDfaWA7q6Z0mjJbZVvPvqJasBa/Cj 1DLknGv0MW8Zy9ytAO7FgPD1gQgGcn70U4MSG7HVfIeNpVtd3qFS56nSMmvv8lWVWja0 nD5mvN64Xtq1z/8hNvo2yP8HpGDxNKf4x2f8L0dbjKj2frPKsEPN+6uh8n1nRZLRXxdC LsJA== X-Forwarded-Encrypted: i=1; AJvYcCVsv0fDSnndH+XXQJWJuq/HkrggSj79ErLgppw1O+KJoasgZDPaRPJHjTLHf3rexAqJ7oclzoZt5A==@kvack.org X-Gm-Message-State: AOJu0Ywb82NzLieyqC+RRkFZJDB79u82gOTLn3pe6yV2l01eTJW3jfQj onTAYrFSWDVYq09+s5evQroI4s0pdj6pmlDJriuAPq32yQPFwCq5 X-Google-Smtp-Source: AGHT+IFqjeYqDDW0p7ov7mbsWnsDnaInYvg+SCciG16pXiE/HxsuLuxNulpcZ6NEkxObce1PH5rryg== X-Received: by 2002:a05:6a00:9160:b0:714:1a71:cb0a with SMTP id d2e1a72fcca58-715e101f8camr11560642b3a.10.1725049752281; Fri, 30 Aug 2024 13:29:12 -0700 (PDT) Received: from localhost.localdomain ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-715e56d74eesm3257035b3a.147.2024.08.30.13.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 13:29:11 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: akpm@linux-foundation.org, linux-mm@kvack.org, virtualization@lists.linux.dev Cc: david@redhat.com, 42.hyeyoo@gmail.com, cl@linux.com, hailong.liu@oppo.com, hch@infradead.org, iamjoonsoo.kim@lge.com, mhocko@suse.com, penberg@kernel.org, rientjes@google.com, roman.gushchin@linux.dev, torvalds@linux-foundation.org, urezki@gmail.com, v-songbaohua@oppo.com, vbabka@suse.cz, laoar.shao@gmail.com Subject: [PATCH v4 0/3] mm/vdpa: correct misuse of non-direct-reclaim __GFP_NOFAIL and improve related doc and warn Date: Sat, 31 Aug 2024 08:28:20 +1200 Message-Id: <20240830202823.21478-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: nxdty8bioonp34f7jdm1aco6nwmb8xph X-Rspam-User: X-Rspamd-Queue-Id: 0048FC0017 X-Rspamd-Server: rspam02 X-HE-Tag: 1725049753-185029 X-HE-Meta: U2FsdGVkX19WuqTRMjrQFACr4J7nUD4p0EeuumEGm7ggKuXAZ+8ZiZ1AvITqHABaEzqJjz6yO0Fw73NJPFCABQPmrWns3gwSeTCEEA1hnsOsDEAqL+7F3pkjHuphQtGQJ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kWp7guQIZJu03p5OXkCsk/AnTF3cI6Wte/3e2X1h7X+arY8d+dZBPwsENyJIGsxZx38+fxKQ79DWxBVcDhEsjsCgsFHaivc/duHAnbMbAMQO2da4Ihj/g7PfHzks6fjQfNSCq/BFYKftDppiyiQhSPF0+/9+Bp8goqULqGZYqocb8qqcM3mJ8SK8K/C8LFQUqJ+bOgyf+66flMpczMUY/tphYVj/7FTI/RrhwpuWIQv2rsXDytnXTXpLWwzA+BI7wiYUMy5cL+u2myBgtuPxqj7jWJ4Tckhsz86h9mb20H/S/PA28uv+Vl64wTBOJ1Ee3rVwhnKamfqdNnZhNJHZNW4WsW0bJKlCmwWeQB5Dsme3XfLml6lw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/vdpa: correct misuse of non-direct-reclaim __GFP_NOFAIL and improve related doc and warn
|
expand
|
From: Barry Song <v-songbaohua@oppo.com> -v4: * drop all BUG_ON, Linus, David, Yafang; * warn in a better place, Vlastimil; * drop patch 3/4, the maximum supported size for __GFP_NOFAIL will be discussed separately, Michal; -v3: https://lore.kernel.org/linux-mm/20240817062449.21164-1-21cnbao@gmail.com/ * collect reviewed-by, acked-by etc. Michal, Christoph, Vlastimil, Davidlohr, thanks! * use Jason's patch[1] to fix vdpa and refine his changelog. * refine changelogs [1] https://lore.kernel.org/all/20240808054320.10017-1-jasowang@redhat.com/ -v2: https://lore.kernel.org/linux-mm/20240731000155.109583-1-21cnbao@gmail.com/ * adjust vpda fix according to Jason and Michal's feedback, I would expect Jason to test it, thanks! * split BUG_ON of unavoidable failure and the case GFP_ATOMIC | __GFP_NOFAIL into two patches according to Vlastimil and Michal. * collect Michal's acked-by for patch 2 - the doc; * remove the new GFP_NOFAIL from this series, that one would be a separate enhancement patchset later on. -v1: https://lore.kernel.org/linux-mm/20240724085544.299090-1-21cnbao@gmail.com/ __GFP_NOFAIL carries the semantics of never failing, so its callers do not check the return value: %__GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller cannot handle allocation failures. The allocation could block indefinitely but will never return with failure. Testing for failure is pointless. However, __GFP_NOFAIL can sometimes fail if it exceeds size limits or is used with GFP_ATOMIC/GFP_NOWAIT in a non-sleepable context. This patchset handles illegal using __GFP_NOFAIL together with GFP_ATOMIC lacking __GFP_DIRECT_RECLAIM(without this, we can't do anything to reclaim memory to satisfy the nofail requirement) and improve related document and warnings. The proper size limits for __GFP_NOFAIL will be handled separately after more discussions. * The discussion started from this topic: [PATCH RFC] mm: warn potential return NULL for kmalloc_array and kvmalloc_array with __GFP_NOFAIL https://lore.kernel.org/linux-mm/20240717230025.77361-1-21cnbao@gmail.com/ Barry Song (2): mm: document __GFP_NOFAIL must be blockable mm: warn about illegal __GFP_NOFAIL usage in a more appropriate location and manner Jason Wang (1): vduse: avoid using __GFP_NOFAIL drivers/vdpa/vdpa_user/iova_domain.c | 19 ++++++----- drivers/vdpa/vdpa_user/iova_domain.h | 1 + include/linux/gfp_types.h | 5 ++- mm/page_alloc.c | 50 ++++++++++++++-------------- 4 files changed, 41 insertions(+), 34 deletions(-)