From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E02C63858D1E for ; Wed, 29 Mar 2023 13:17:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E02C63858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680095854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ud+z1cHN+7I/p7og1O0XGbpFI5CX1oniFTVqTfzsg1s=; b=I2FoVkQSySthAKP/5r+z6AEk3QWtZtbQjgY16bTxMYglXjtnOd5KjtvPJXdK28YgIW7+cx AE7fMoIpdPBlva2Uu9LLIW3LHLcVwW2v6bpvVYVwEMs6d00ltKO/KibzDgxy8vsjRZhbc/ PBjQ6f15wHPX6ta3wKYS24veEi16KGI= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-nM-ueXWvNMu7R2RKBnYd4g-1; Wed, 29 Mar 2023 09:17:33 -0400 X-MC-Unique: nM-ueXWvNMu7R2RKBnYd4g-1 Received: by mail-yb1-f200.google.com with SMTP id 204-20020a250fd5000000b00b6d6655dc35so15248706ybp.6 for ; Wed, 29 Mar 2023 06:17:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680095852; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ud+z1cHN+7I/p7og1O0XGbpFI5CX1oniFTVqTfzsg1s=; b=qYRpwHoYHB7RBAKFXIf2O+auvgyNbFmOnqgPddTNPVA0XEvcDz30vEEIdZED1nLR4s Spl4RTq8CORgZVOQEN+vFcnoX0/4dQ2RRv5AwvLqg+HSGBNySBVhneHIwASvNR4HNYAq iPLIGtmDA3aRARoQkdwdFVwAKBWCX5AgCi+uAqzdVnundknhbE5Vdb0VqWn7qRUZ+8E/ HJsxBrjXgU3G9RmeNFL7WkU9ScBszEkcypWtEKtPaKRUscYeJxoCdMUY+zfK1KwEEhTo qaIXbdj8whBIZbduPUw3nYat4JNDENtlG2uDoSxwfocWSZFYq6loDEkj5x+T2yHKaoj0 +QVg== X-Gm-Message-State: AAQBX9cZSldocX8KH8P68EfNhv4iNT9vhKcnfS/xwXjaddmD4vPc/QrU MSriXDsygTd6JpNhNCFn2aOFGSV4YOdRn3AchKqy/jjGxSCLdGybPz6iDW/O49usleC+eq/J50A 3WYKjs6SE1e/PbEO8oJsNxNdo8xyz X-Received: by 2002:a81:5549:0:b0:544:85d9:ae38 with SMTP id j70-20020a815549000000b0054485d9ae38mr2441133ywb.13.1680095852647; Wed, 29 Mar 2023 06:17:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Y21EkqvbjEgU8FgIeoNnR9pVSWLtvh0gMFNEg2uHxh9K1ycMykG7SHQSHTmoUeY/yxhSJJhQ== X-Received: by 2002:a81:5549:0:b0:544:85d9:ae38 with SMTP id j70-20020a815549000000b0054485d9ae38mr2441117ywb.13.1680095852357; Wed, 29 Mar 2023 06:17:32 -0700 (PDT) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id s12-20020a25aa0c000000b00b7767ca7497sm3473988ybi.52.2023.03.29.06.17.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 06:17:31 -0700 (PDT) Message-ID: <481ef2c5-a59f-dea4-7f5f-2fcd229a4c25@redhat.com> Date: Wed, 29 Mar 2023 09:17:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v9 0/13] implement dlmem() function To: Stas Sergeev , libc-alpha@sourceware.org References: <20230318165110.3672749-1-stsp2@yandex.ru> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20230318165110.3672749-1-stsp2@yandex.ru> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/18/23 12:50, Stas Sergeev via Libc-alpha wrote: A cover letter needs to explain in detail what the series does and why glibc should include the series e.g. use cases, workloads. Adding a new API is a serious thing for glibc since we will keep the new interface for a long time, like the Linux kernel, and need to ensure that it is a generic enough building block that we can use. Please provide the details here about why glibc should incldue dlmem() and which use cases it enables that existing APIs can't easily support. > Changes in v9: > - use "zero-copy" machinery instead of memcpy(). It works on linux 5.13 > and newer, falling back to memcpy() otherwise. Suggested by Florian Weimer. > - implement fdlopen() using the above functionality. It is in a new test > tst-dlmem-fdlopen. Suggested by Carlos O'Donell. > - add DLMEM_DONTREPLACE flag that doesn't replace the backing-store mapping. > It switches back to memcpy(). Test-case is called tst-dlmem-shm. > > Changes in v8: > - drop audit machinery and instead add an extra arg (optional pointer > to a struct) to dlmem() itself that allows to install a custom premap > callback or to specify nsid. Audit machinery was meant to allow > controling over the pre-existing APIs like dlopen(), but if someone > ever needs such extensions to dlopen(), he can trivially implement > dlopen() on top of dlmem(). > > Changes in v7: > - add _dl_audit_premap audit extension and its usage example > > Changes in v6: > - use __strdup("") for l_name as suggested by Andreas Schwab > > Changes in v5: > - added _dl_audit_premap_dlmem audit extension for dlmem > - added tst-auditmod-dlmem.c test-case that feeds shm fd to dlmem() > > Changes in v4: > - re-target to GLIBC_2.38 > - add tst-auditdlmem.c test-case to test auditing > - drop length page-aligning in tst-dlmem: mmap() aligns length on its own > - bugfix: in do_mmapcpy() allow mmaps past end of buffer > > Changes in v3: > - Changed prototype of dlmem() (and all the internal machinery) to > use "const unsigned char *buffer" instead of "const char *buffer". > > Changes in v2: > - use instead of "../test-skeleton.c" > - re-target to GLIBC_2.37 > - update all libc.abilist files > -- Cheers, Carlos.