All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kameron Carr" <kameroncarr@linux.microsoft.com>
To: "'Michael Kelley'" <mhklinux@outlook.com>, <decui@microsoft.com>,
	<haiyangz@microsoft.com>, <kys@microsoft.com>,
	<longli@microsoft.com>, <wei.liu@kernel.org>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<linux-hyperv@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>
Subject: RE: [RFC PATCH 2/2] hv_netvsc: back GPADL buffers with kmalloc + decrypt + vmap
Date: Fri, 31 Jul 2026 12:06:18 -0700	[thread overview]
Message-ID: <000901dd211f$b119be20$134d3a60$@linux.microsoft.com> (raw)
In-Reply-To: <SN6PR02MB41576F1E9A4F0AC3D6AB8C18D4CF2@SN6PR02MB4157.namprd02.prod.outlook.com>

On Friday, July 24, 2026 12:37 PM, Michael Kelley wrote:
> From: Kameron Carr <kameroncarr@linux.microsoft.com> Sent: Tuesday, July
21, 2026 12:57 PM
[...]
> > +	/*
> > +	 * @order monotonically decreases across iterations
> > +	 *
> > +	 * Use __GFP_NORETRY | __GFP_NOWARN to avoid OOM-killing, but try
> > +	 * harder at order 0 since that is the final fallback.
> > +	 */
> > +	order = min_t(unsigned int, MAX_PAGE_ORDER, ilog2(nr_pages));
> 
> Prefer using min() instead of min_t(). For normal integer values,
> min() should work correctly.

Using min() compiled fine on ARM, but x86 is throwing a compile error.

    drivers/hv/channel.c: In function 'vmbus_alloc_buffer':
    ././include/linux/compiler_types.h:699:45: error: call to
    '__compiletime_assert_518' declared with attribute error: min(order, (
    __builtin_constant_p(remaining) ? ((remaining) < 2 ? 0 : 63 -
    __builtin_clzll(remaining)) : (sizeof(remaining) <= 4) ?
    __ilog2_u32(remaining) : __ilog2_u64(remaining) )) signedness error

In my v3 I may go back to using min_t. Please let me know if a cast (or
some other method) is preferred.

-Kameron


      reply	other threads:[~2026-07-31 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 19:56 [RFC PATCH 0/2] Drivers: hv: decrypt netvsc buffers on contiguous direct-map addresses Kameron Carr
2026-07-21 19:56 ` [RFC PATCH 1/2] Drivers: hv: vmbus: add vmbus_establish_gpadl_caller_decrypted() Kameron Carr
2026-07-22 19:57   ` sashiko-bot
2026-07-23 17:52   ` Michael Kelley
2026-07-23 21:14     ` Kameron Carr
2026-07-21 19:56 ` [RFC PATCH 2/2] hv_netvsc: back GPADL buffers with kmalloc + decrypt + vmap Kameron Carr
2026-07-24 19:36   ` Michael Kelley
2026-07-31 19:06     ` Kameron Carr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000901dd211f$b119be20$134d3a60$@linux.microsoft.com' \
    --to=kameroncarr@linux.microsoft.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=mhklinux@outlook.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.