Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp395902rwb; Tue, 13 Dec 2022 19:38:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZQk+KKr/tVYLh0n/BJ5+oPIkwwnn21KvuYlxUAm4GPZwB+SY/AGMBt2waMHMvvnsIw28N X-Received: by 2002:a17:907:c78f:b0:7c1:4e8f:df2f with SMTP id tz15-20020a170907c78f00b007c14e8fdf2fmr19164585ejc.17.1670989120812; Tue, 13 Dec 2022 19:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670989120; cv=none; d=google.com; s=arc-20160816; b=tlPW7C3LV3zT7rtgQyoQnjG3BjMuNqbUycktYdsNpwm00/8Z2EMa7n5uz0yo6AVa33 2IyL0zG7B372HQoGLbY9EiRT6tTVVkj3yCNq76In1bGwjOrjD3CW72v+BSrLQ6bZscKa VNNmGuQoAuDMBogyH/6thnOWtGp1xRA0KoRRkJobsrX0Rk7H5kJxr6sRk5bifVW2TyZ9 9rX/U0iXnoZFHE4XamY+eEPc9S8HOk4kGX185YaQ5r3IPnQnrM8Nxwz+c/M4DsBDTkrd 6tqD5sjjwPHRI4Vw0/rCGWT+P54uglUg9Ypt4QRo1XN9uAvaePUJG9ph7iK3ftvPAFto U5vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=Q0RmDmYwpbIyE85XfYoMhQZGsS4z4RgrTyeIW41Vt/Y=; b=M4FpzRNliPGsDWAT+fWnzjcQSGv5zoILit5Elz4jK48H5Wkh+lC/C0xfoAl2UCRCwE yUPLXixJbRdC3rOuQ4UEurFNJAaVQBCtmKTf/i0ARkKv/jCfvmrcja6UyBfNE5wJe9qw X4CAVzIaI+l9RYKmTgzEEWvwpqOsKY+k1p270qU5cO4AutSE5zdWOsdXUhqs/aXXl+Uv FvRxmTJYmXIO+PiM3PBRui4ec81O5T/+4bbfrkkhD1UNVfi1JgRZi8YZ0n5DAoujWKa0 SciDieCVT2psr/LGFrQeWo+2ovXNNWqOkRL3d2k646VEbLHDzjBIZsvLZt3qS7VEOz9E rJ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="o/iSUFNF"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ke26-20020a17090798fa00b007b5911c9b13si8084014ejc.831.2022.12.13.19.38.24; Tue, 13 Dec 2022 19:38:40 -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=@linux.dev header.s=key1 header.b="o/iSUFNF"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237162AbiLNDAo (ORCPT + 70 others); Tue, 13 Dec 2022 22:00:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235717AbiLNDAm (ORCPT ); Tue, 13 Dec 2022 22:00:42 -0500 Received: from out-48.mta0.migadu.com (out-48.mta0.migadu.com [91.218.175.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1DC13F7F for ; Tue, 13 Dec 2022 19:00:40 -0800 (PST) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1670986838; h=from:from: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:in-reply-to:references:references; bh=Q0RmDmYwpbIyE85XfYoMhQZGsS4z4RgrTyeIW41Vt/Y=; b=o/iSUFNFyCfQp4W4+GNKbDJJbAHyg0307cIwXvhUOsYnOU+DzurDKmS+my1sPCsuJWNMsT Uw++bFVXpt5y90UqNzmhiU2lyOielX9QLYDQHTJFNbJCJd0O88v/wZDALo6LfLL/SOqiv5 N9Cpk2WmnWN1f/CqIVRdm1Qkh42n+IA= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: [PATCH mm-unstable] mm: clarify folio_set_compound_order() zero support X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <23fa4ffa-965a-da80-e8b5-73ae92dc5767@nvidia.com> Date: Wed, 14 Dec 2022 11:00:02 +0800 Cc: Sidhartha Kumar , Mike Kravetz , Matthew Wilcox , linux-kernel@vger.kernel.org, Linux Memory Management List , Andrew Morton , Muchun Song , tsahu@linux.ibm.com, David Hildenbrand Content-Transfer-Encoding: quoted-printable Message-Id: <00CBD2D1-EEDD-4171-94F4-8DCC0446F26E@linux.dev> References: <20221207223731.32784-1-sidhartha.kumar@oracle.com> <92965844-c430-8b8e-d9f1-705d7578bceb@nvidia.com> <0187f9c2-e80a-9cde-68bc-c9bdbd96b6fe@oracle.com> <2723541a-79aa-c6b5-d82c-53db76b78145@oracle.com> <36ddac45-ecd0-e2d2-e974-8c85ca503053@oracle.com> <20cc2088-b66e-28d1-a529-414e82146336@nvidia.com> <434a111c-7f1a-0018-6bd2-561cb382deea@oracle.com> <7d72778e-7305-18e9-edf4-ed55a98aa7e2@nvidia.com> <00222280-DBDD-49A3-92A5-05112359AE30@linux.dev> <23fa4ffa-965a-da80-e8b5-73ae92dc5767@nvidia.com> To: John Hubbard X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Dec 10, 2022, at 05:20, John Hubbard wrote: >=20 > On 12/9/22 13:10, John Hubbard wrote: >> On 12/9/22 06:27, Muchun Song wrote: >>> =46rom you advise, I think we can remove VM_BUG_ON and handle = non-zero >>> order page, something like: >> Yes, and thanks for summarizing all the individual feedback into a >> proposed solution. >> If we go this route, then I'd suggest a little note above the = function, >> such as: >> /* >> * For non-large folios, this will have no effect, other than = possibly >> * generating a warning, if the caller attempts to set a non-zero = folio order >> * for a non-large folio. >> */ >>> static inline void folio_set_order(struct folio *folio, >>> unsigned int order) >>> { >>> if (!folio_test_large(folio)) { >>> WARN_ON(order); >=20 > Although, on second thought...I'm still a little confused about why > keeping the same name is so important? Just my personal preference. I like its simplicity. I'm not against large_folio_set_order, but suggest folio_set_order. Thanks. >=20 > A very direct approach that has more accurate naming (and therefore no > need for a strange comment explaining the behavior) would be: >=20 >=20 > static inline void large_folio_set_order(struct folio *folio, > unsigned int order) > { > if (WARN_ON_ONCE(!folio_test_large(folio))) > return; >=20 > folio->_folio_order =3D order; > #ifdef CONFIG_64BIT > folio->_folio_nr_pages =3D order ? 1U << order : 0; > #endif > } >=20 >=20 > thanks, > --=20 > John Hubbard > NVIDIA