From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF0D718871F for ; Tue, 30 Jun 2026 12:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782822714; cv=none; b=uJESPBdmDgQ4SBOE3qB6bTsmmnEBtUbV7WCyLWpJ3+IS3z8dKBKwr8TdZ8v73c+5hWpLiXQ17tJekMqMljf/Shxs3+qZCfQkekudZOsUmwPBiDf1UN43UUvIshfThFKZRT9ZS7Y0OR8no1+ZgYePwCZgGxKltI6TKmxqMh2CCXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782822714; c=relaxed/simple; bh=K6zzVV0af8xAaoAtSqcQxD8uDRZmwf0GT2DpjrnXsAg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DoDI+dbU9WwaYJ2PcXISvfvWESm7bQad8xthRm0iBaTlQHFNokfeA1UQgilAaVKQyN7ExViV6cdAOWFSbybx2iDN2e2wytK/Pxi3nfBQoyRBJGrSzkO2oprZ8fK2rS2hywwqSjbjVGFdvTjfp9uuJrCYGY5wDukOCRN2iWAKRQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=f5fSd7Tl; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="f5fSd7Tl" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-8e5be46f663so32771046d6.0 for ; Tue, 30 Jun 2026 05:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1782822712; x=1783427512; 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=K6zzVV0af8xAaoAtSqcQxD8uDRZmwf0GT2DpjrnXsAg=; b=f5fSd7TlbMNE8bbKuAbrv+VmvqOJfVyi0ivLv5jLhIFVA9QNYLhziCyexGcP3JAgSw uTPz6ByVtb8X1bj/ujD2XgsVit/zJWocV883Ep7Mr3/0eojX5dzHITd0pGPa1aqBX4YZ yOiSVGhmFeGT2siQhcEjHSHQE1pbaM7wTnvoI/R4LNeuSXPvimF7KvwTSzzSkxtskW98 0I8j58N+I5f93ZCVcjkslK1pkYlyUzZW44fNgtsH0jIrMPAklvxr7P48DcdxUPAu7cKh BRGarnX2QG4fUTvevxyffU1tBspBPs+oPLsYgg+iszuZUVE3H/EmOxRpUevbKmJjfEEh bJyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782822712; x=1783427512; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K6zzVV0af8xAaoAtSqcQxD8uDRZmwf0GT2DpjrnXsAg=; b=YgUyreEBADLp/cG46h3s6GP+ZhZgZCXS/5m/SbQ5RxNUzM/gOXRU8OefEsv+hEiyOE 3ZI78a5+RgD4QZsGSAKr9z3J/DSDTXxV0S3kDcfqc0vPWiiaZsIB6IkMhOW14/Rd8gIe DBh0UcYmQhF5mnd9Dlxc68unLWGDjIgcSIqBIz4qlp01izHiVCQropG1Cs9xNKraUh7P fHnka5kgdRMD8BRtzT+XwYjqor8wJzWxwUexZRUWpDEgCr8Iyhl2452HhDJWHprviTuB BeWgnl5iOogZ/J9ZozCpcvmcr04oExUqs8phgRvwi91wBm0erZ9CsY1/MLudnaPywpdY tgWQ== X-Forwarded-Encrypted: i=1; AHgh+RqFXFU5XmOTOa981WeuUfvtsLFCJhlAAIQCjHlCOs/CRd06lxJ7Np5aP89VGQRYNibG/IEimn+KgltWn4w=@vger.kernel.org X-Gm-Message-State: AOJu0YwY5S0ukJzbEhfoxZQIOvaSa3F6IQmbBsgwahKygttq8KBjGQ8O otod3Uk2MauhpNMost+nqvk3abY8xYSDpngWVZyTkYXqL+6+yiD1jjOKCkr9lYolHao= X-Gm-Gg: AfdE7cmJUr6kGPu6awkiWn1C1v5DON+i0Gwe8p9YimvGnUYt2qjuOe7TFqQIYh3Loil N+94zsI7gnBQDSHyRax+Nx6PZAVwaQVxYH/z37fL9l2O2gJGPmUcTgpa1dmgvQdqmQBR19aVO01 v53itlTST8GJb4mHvgiRKbACRBWyFUGBGQW7PZCTHVDGgChum8MMDj1RDkoNZRc+QqyJrjXJjFd E4HCY6288W2HCBNFsxvPEAz8ZZTtiE9ANqIQTAXVB/Nr6ASL/aSJFCnEcFAsSNXSUfTS+lDltfS lbDIt7Io44gPQKTWZt52nMk+0Q/sg0LdJkBKusFSdgmx34YmoE3REAwfYOH+p2C6ye3SyRrbyro wmQNK/Dgn/MKVlR1KybnPuHgazq6chhycsp1agR7OtJIpIqOWV2qT3Yh0XbBz4FVi01euQNGazj TBZH1mKNYF9CXiMagyIEJVn8he4vb50LvRUpYUv3TKaQfd+boUdYYbS3EBcPuuOnAvvy8= X-Received: by 2002:a05:6214:31a0:b0:8f0:275e:8b3a with SMTP id 6a1803df08f44-8f1be38d9f0mr47693926d6.48.1782822711717; Tue, 30 Jun 2026 05:31:51 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8f1a328fed8sm22758066d6.16.2026.06.30.05.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 05:31:51 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1weXd0-00000001ppa-1Uxh; Tue, 30 Jun 2026 09:31:50 -0300 Date: Tue, 30 Jun 2026 09:31:50 -0300 From: Jason Gunthorpe To: "Mike Rapoport (Microsoft)" Cc: Leon Romanovsky , Dennis Dalessandro , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH 1/5] RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array Message-ID: <20260630123150.GB7525@ziepe.ca> References: <20260630-b4-rdma-v1-0-ab42bcf0de92@kernel.org> <20260630-b4-rdma-v1-1-ab42bcf0de92@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260630-b4-rdma-v1-1-ab42bcf0de92@kernel.org> On Tue, Jun 30, 2026 at 01:52:29PM +0300, Mike Rapoport (Microsoft) wrote: > ib_umem_get() allocates an array of pointers to struct page for > pin_user_pages_fast() calls during memory registration. A whole bunch of these use cases in rdma are really "give me some temporary memory, I want it fast and as large as possible. In a syscall context I will free it before returning back to userspace" eg we'd be really happy to get any kind of high order page here. So, how would you feel about a new API? void *kmalloc_temporary(size_t min_size, size_t max_size, size_t *actual_size, gfp); I know of a few other cases like this in the kernel at least. The implementation could try to find an available high order page and immediately return it, otherwise do a small reclaim allocation? Jason