From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0F2E04AEC9 for ; Thu, 29 Feb 2024 15:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709222195; cv=none; b=VIgGo53hUKp5n7urFt33U37t9D0oX7Y0lXH/Jyr6ebOiqjYg0pk8ci+9vAFLvTqkkCZcP8t5lyulaOSuS3jYdPPqa/6vhpnCWdIXW2VQWudH8LzuHFtKsHRmKHS7mrJeNvqMdEquMf9zPv5IX/V2BHBzV4T26UlHmPglvOTzF8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709222195; c=relaxed/simple; bh=czcrIZvv5lDveBU2cHYcvqVFr6Snkh6UCtf3GKl3naQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XwEv2vzVxh2LF3HJ+geXkP6sWaEfEpQLQhZlODnBUqGJ4RwzQoz/Fm00MkiD4YzDJcRzqE1U+yXdp1H5Nh2I5xd8t8eTQYo/yB0k6GxbTx0VFhfN9W5UqglzNu10IFJBVYAaDrgIWhbLDkBeMw5LEwpf0Vl53n/QdyflSAvxYM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=MyDA82W9; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MyDA82W9" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZZeeQhzP/DHpKF5QdT9LDfZVh1KeLzxu5kAiu8X0IuI=; b=MyDA82W9Ybj19i6XFkxtLJHcIj DIdV0B551cX9Of1vbLiE7wQyZ+QZ5s8/rx8PcMT7ZPqE5MxTVE1PqdqAGpoLtaEP7Z4GODcSqBYpf +5PUuQblRp6R9otKcB2rgpT/TckK30wW/x9kWHfBUBOEYLAv9ENYNYjr74JbVv+4HkHvDmFDcyos1 L5Gi5pVl5ETAKTSF6e0VODoCUz2lHFEdWX18oSiBxUvU0VJHDtUoU+XqIK7UWxX26b+RFFj8q7AE8 7UYQl/Ts9ehrXAidDb+ChLkR4jo9tWvXsBvM8DXn+wWbhjnOn95vr0rgW5lmvfOKAFxXuYbK3wwqj Ze2WUX/Q==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfilp-0000000E9xh-2JaC; Thu, 29 Feb 2024 15:56:29 +0000 Date: Thu, 29 Feb 2024 07:56:29 -0800 From: Christoph Hellwig To: Alexei Starovoitov Cc: Christoph Hellwig , bpf , Daniel Borkmann , Andrii Nakryiko , Linus Torvalds , Barret Rhoden , Johannes Weiner , Lorenzo Stoakes , Andrew Morton , Uladzislau Rezki , Boris Ostrovsky , sstabellini@kernel.org, Juergen Gross , linux-mm , xen-devel@lists.xenproject.org, Kernel Team Subject: Re: [PATCH v2 bpf-next 3/3] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages(). Message-ID: References: <20240223235728.13981-1-alexei.starovoitov@gmail.com> <20240223235728.13981-4-alexei.starovoitov@gmail.com> Precedence: bulk X-Mailing-List: bpf@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: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Feb 27, 2024 at 05:31:28PM -0800, Alexei Starovoitov wrote: > What would it look like with a cookie? > A static inline wrapper around get_vm_area() that returns area->addr ? > And the start address of vmap range will be such a cookie? Hmm, just making the kernel virtual address the cookie actually sounds pretty neat indeed even if I did not have that in mind. > I guess I don't understand the motivation to hide 'struct vm_struct *'. The prime reason is that then people will try to start random APIs that work on it. But let's give it a try without the wrappers and see how things go.