Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2487765lqt; Mon, 22 Apr 2024 12:06:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjQRdzGSmcVkbypkqghhMPcfZYPZBSJXJXKrAr0dHt7RuPb99Etz5rqgFvIF6+25TfO/YQPqt8L6CYFYWRYAb7SiuGOsPuGeYlwhe+Wg== X-Google-Smtp-Source: AGHT+IER7S6p/pVPlS93sPvXULtL3IVGB6o99eTGzW0UaEQ/i5Gekhydi/zWADn09u+VA7afvDr0 X-Received: by 2002:a05:6300:8a07:b0:1a9:5e63:500e with SMTP id jp7-20020a0563008a0700b001a95e63500emr6730240pzc.27.1713812765848; Mon, 22 Apr 2024 12:06:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713812765; cv=pass; d=google.com; s=arc-20160816; b=VWWo+JQIUIYv5edxcYNg5QqtFpvBQF9L/qNlrKTYDgMXKfJLrj40fIfI0ZjySEyYAI Md8NWn76efYTWLsvLJGWtZpwg/qjUI/h2WMxRLBFr0WSM46uS9rc7+hb5CItq40ZhSRm TivULjNM89TL+KsFr+D+N2+44G1b+qOUrnFG2CIoasGivpBmxkBxp+ujuWXC0EjEeGdm /cPBcncSSnQjNHFusEU0Nn/PrmuhNDnHoC+NA6PzoSS3j37TUsjxhw4L7gqwqxlcrxhb t0vvo1KhoOn+nYVIuwAdVBmfwpBiCF7RXQAzNHSrJ7TN61UQfD5dck7JxzXfUhmrmsxy i1ZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=2IoiI1CKWdxT08QT1d5cFnQm5ub6rZ7mUR7ZdEDYUaU=; fh=P3bbA2iFUTKgKWrpxubH6Qr8MW2foxB5mvrPeqhyXv8=; b=IRFUWcogG5AQvLzED/Jdfmeqqi6WsIk/49BHp9s3vFBnfbnxpV7BIEiBs1VBF9dpOu EjdpuoCO59X4P7rVSmD08c6AWZce4Ts2WKgMGObAn9nL9LDim1rgkPHv8Z8IcPNZlN9E UePU1yI8NKZKvCRWrE1joXdaZKw0Di8Hy9dzQZiSw2hzhHwO8+95wrDzQR4Sah7mK4bR xXYO9N23T7KVjZFMTiHQmBfUNDY/XOu6pq3fQMNM5jhUK72rp09SWPPpZ+Dja+OQR7ag 6bPtObQ6nSfNMUHCVvwEAXUEZyd1cMny4tpgcTVea78xIlvTCX3A6OSocwjR/bxE3Bwp 1XRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XFzpjZ54; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-153886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e19-20020a630f13000000b005dc4e366f46si7937008pgl.127.2024.04.22.12.06.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XFzpjZ54; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-153886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A5BCBB24263 for ; Mon, 22 Apr 2024 18:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A73341552E3; Mon, 22 Apr 2024 18:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XFzpjZ54" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 DB04D154BFF for ; Mon, 22 Apr 2024 18:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713812366; cv=none; b=KNCZC7QY3b/aVkwMevsDuS9Feb/sGz1pKmV3lFRnEcekHFH6GhjmXguh1CP28Ge4urdfK5zsLlB6xE5p1TxRovZHTAXok9gJAFI12osRV8w+jDhbXuG3oE03Yiw7ndXRmuM65MdbqYyby3T95jeZwPkVOjdVq2AbXCYCK3gGQxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713812366; c=relaxed/simple; bh=+yT1cKHrMfv6BIVPIWySVlA2i3fir6luGW5GOp0DQ/g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pbL2we9V9QERodexLPjDh7zHdvCvwun952KjFrUsbohZxmqdJaNWeFCFYroPmNUeJXGzVrTh20njGqlUo4156ZynZ7b/5o3EPwUKftvWkxzHVuLOpKr+dWbQJRmVIAte4rFA3InptWtJHVRcZhJNaqovQa/lKz4MyKVkpqf8BVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XFzpjZ54; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713812363; 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:autocrypt:autocrypt; bh=2IoiI1CKWdxT08QT1d5cFnQm5ub6rZ7mUR7ZdEDYUaU=; b=XFzpjZ54TrAzbpS2ZIJOKFsSDWXNwUux+HdMdxFG/eQMUFDIg3RrDbj2aRcO7+jdNhNyKG p1qQI7YuJOwFd/uWNqq9r5CWdEdig5Fu5gtAMkw3jiX2kEsZlkcG4izjO9hGjPFKwHjctJ 8NSljwC+M+RUnDfWfpMZJOyHA/vlYKw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-3rersuA5N82dY3sVCvgRXw-1; Mon, 22 Apr 2024 14:59:21 -0400 X-MC-Unique: 3rersuA5N82dY3sVCvgRXw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-34b0b409775so716535f8f.2 for ; Mon, 22 Apr 2024 11:59:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713812360; x=1714417160; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2IoiI1CKWdxT08QT1d5cFnQm5ub6rZ7mUR7ZdEDYUaU=; b=UrIe/Rdm5gP2pKGSnKrmLozsl31wK4m78Q6QEdIz+c7jnY/kUy0h7D7X7U/eLQhNTn fR4WVO0ngxx42ZUuxMdpCmvUOqSrWwG58UpCCkMQQzTBg8c1b5/mjDEJCl1zOpObJUK1 qWdsdrinroTSd6AuYTDTlLbHlQZvzVuzZbMi7QxFG3ayAEvYGGq8tSbsDW3Tu/I93j+v ndhkQl+5a+xYty2GEIkMedgeeld66zjetP9Ms/6LiaFJ2YwXbWbAhQCPar0zh5YbqStV S3iFE5yLHO73lpJoMTVphcKPcKxuPDnOI2VecBtUZKfUIMh4xftpt7HYXO4YnfvjwaOv EeGQ== X-Forwarded-Encrypted: i=1; AJvYcCVRESvH2IaNiBg/8Xp2qfYWJQOh+CDORPpQoUwqOTJPKOS5AvriTne8Pm/ocBUkIXPvty5h4kf0yx1E6C+FyFbk62Khb/4oMoZOhmJb X-Gm-Message-State: AOJu0YyAFo47LcvPwdUzCjOhZtIuqJagZoe2Raaj1lXw5a+cA5TW7v0o oOxVNIybZ361lwB12JRTfvKotAoIORVtCZcSMqM4+Ovs8lAz1b4ijXzJl7VyBLZZgGJv4wk9A44 kKM78qLIQrkSUDnL8ZxN1lyHUjqhhADEYffZqPJ7HzH3aL2wnpAdVCxxfoRVanA== X-Received: by 2002:adf:f18b:0:b0:34a:1a7a:9d60 with SMTP id h11-20020adff18b000000b0034a1a7a9d60mr7523613wro.62.1713812359958; Mon, 22 Apr 2024 11:59:19 -0700 (PDT) X-Received: by 2002:adf:f18b:0:b0:34a:1a7a:9d60 with SMTP id h11-20020adff18b000000b0034a1a7a9d60mr7523598wro.62.1713812359499; Mon, 22 Apr 2024 11:59:19 -0700 (PDT) Received: from ?IPV6:2003:cb:c739:600:d2fb:3a8a:9944:7910? (p200300cbc7390600d2fb3a8a99447910.dip0.t-ipconnect.de. [2003:cb:c739:600:d2fb:3a8a:9944:7910]) by smtp.gmail.com with ESMTPSA id b16-20020a5d40d0000000b00346406a5c80sm12771752wrq.32.2024.04.22.11.59.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Apr 2024 11:59:19 -0700 (PDT) Message-ID: <22fcde31-16c4-42d0-ad99-568173ec4dd0@redhat.com> Date: Mon, 22 Apr 2024 20:59:18 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC][PATCH] uprobe: support for private hugetlb mappings To: Guillaume Morin Cc: oleg@redhat.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, muchun.song@linux.dev References: Content-Language: en-US From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGj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HdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22.04.24 20:11, Guillaume Morin wrote: > (Dropping Mike Kravetz as CC since he has retired and his email is no > longer valid, adding Muchun since he's the current hugetlb maintainer, > as well as linux-trace-kernel) > > On 22 Apr 11:39, David Hildenbrand wrote: >> >> On 19.04.24 20:37, Guillaume Morin wrote: >>> libhugetlbfs, the Intel iodlr code both allow to remap .text onto a >>> hugetlb private mapping. It's also pretty easy to do it manually. >>> One drawback of using this functionality is the lack of support for >>> uprobes (NOTE uprobe ignores shareable vmas) >>> >>> This patch adds support for private hugetlb mappings. It does require exposing >>> some hugetlbfs innards and relies on copy_user_large_folio which is only >>> available when CONFIG_HUGETLBFS is used so I had to use an ugly #ifdef >>> >>> If there is some interest in applying this patch in some form or >>> another, I am open to any refactoring suggestions (esp getting rid the >>> #ifdef in uprobes.c) . I tried to limit the >>> amount of branching. >> >> All that hugetlb special casing .... oh my. What's the benefit why we should >> be interested in making that code less clean -- to phrase it in a nice way >> ;) ? > > I do appreciate the nice phrasing. Believe me, I did try to limit the > special casing to a minimum :-). > > Outside of __replace_page, I added only 3-ish branches so I do not think > it's *too* bad. The uprobe code is using PAGE_{SHIFT,MASK} quite liberally so I > had to add calls to retrieve these for the hugetlb vmas. > > __replace_page has a lot of special casing. I certainly agree (and > unfortunately for me it's at the beginning of the patch :)). It's doing > something pretty uncommon outside of the mm code so it has to make a > bunch of specific hugetlb calls. I am not quite sure how to improve it > but if you have suggestions, I'd be happy to refactor. See below. > > The benefit - to me - is very clear. People do use hugetlb mappings to > run code in production environments. The perf benefits are there for some > workloads. Intel has published a whitepaper about it etc. > Uprobes are a very good tool to do live tracing. If you can restart the > process and reproduce, you should be able to disable hugetlb remapping > but if you need to look at a live process, there are not many options. > Not being able to use uprobes is crippling. Please add all that as motivation to the patch description or cover letter. > >> Yes, libhugetlbfs exists. But why do we have to support uprobes with it? >> Nobody cared until now, why care now? > > I think you could ask the same question for every new feature patch :) I have to, because it usually indicates a lack of motivation in the cover-letter/patch description :P People will have to maintain that code, and maintaining hugetlb code in odd places is no fun ... > > Since the removal a few releases ago of the __morecore() hook in glibc, > the main feature of libhugetlbfs is ELF segments remapping. I think > there are definitely a lot of users that simply deal with this > unnecessary limitation. > > I am certainly not shoving this patch through anyone's throat if there > is no interest. But we definitely find it a very useful feature ... Let me try to see if we can get this done cleaner. One ugly part (in general here) is the custom page replacement in the registration part. We are guaranteed to have a MAP_PRIVATE mapping. Instead of replacing pages ourselves (which we likely shouldn't do ...) ... maybe we could use FAULT_FLAG_UNSHARE faults such that we will get an anonymous folio populated. (like KSM does nowadays) Punching FOLL_PIN|FOLL_LONGTERM into GUP would achieve the same thing, but using FOLL_WRITE would not work on many file systems. So maybe we have to trigger an unsharing fault ourselves. That would do the page replacement for us and we "should" be able to lookup an anonymous folio that we can then just modify, like ptrace would. But then, there is also unregistration part, with weird conditional page replacement. Zapping the anon page if the content matches the content of the original page is one thing. But why are we placing an existing anonymous page by a new anonymous page when the content from the original page differs (but matches the one from the just copied page?)? I'll have to further think about that one. It's all a bit nasty. One thing to note is that hugetlb folios don't grow on trees. Likely, Many setups *don't* reserve extra hugetlb folios and you might just easily be running out of free hugetlb folios that you can use to break COW here (replace a file hugetlb by a fresh anon hugetlb page). Likely it's easy to make register or unregister fail. -- Cheers, David / dhildenb