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.129.124]) by sourceware.org (Postfix) with ESMTPS id 3AD7F3858D39 for ; Wed, 13 Dec 2023 08:52:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AD7F3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3AD7F3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702457540; cv=none; b=XcqSNjoknO99dFvbRFfTOq7e+rqvkwZhiazjvr4OVqkS3AnHuvBDfWcvbi4zvw+XXrUXPx4ouwOvDgarBBHdOidWxZaqTtVDXV3/JB+e/ti+gMpl3tDuZAqT9QbAy9lLOK+d4ZzM2vE8GdNp9PFe1OijnFMLsNfUUa7c2DbI5R8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702457540; c=relaxed/simple; bh=YaQezdDGbNuNaJM6tadMB1c9CWt0m2bn7TU/IbJn7uA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=EguCkLlInxT5NKgX4/swaz5mlpbgCDM8xP7tbpyf6RUAXK0uQPyAd3Nb/60cBhgvHT1myjw00SmRqsuAN+797e5qm2q1RvOfUdS4Mdil1K+E3RYaEy+4RAxLUzR+TYPEecnWp4UqvHdeHV93XYBqzoUrCNzwulZp+/o5iD2ivzc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702457538; h=from:from:reply-to: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; bh=HIEWx7a1jXXBJt3cGNui9QCx68oBvXEeRxPGHnlX0wk=; b=MYno5WAcmJNZJ8qXWv87Z9m19Kzur0MhPibOyQ41nqor9FmcPhRrlrlcKHmo1uc+wu5k8n VLioktcKvU2LYnEX38shjpaiuUoGo60hivA2SyR6zcUhHc1IxaYRR6jJTEVC2vMkDmvAfo McPJLAP5g9bdelhok8canNlflh6+zyw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-3X8whCPvO9mp938hC5K4ig-1; Wed, 13 Dec 2023 03:52:17 -0500 X-MC-Unique: 3X8whCPvO9mp938hC5K4ig-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D7A3329AC02E; Wed, 13 Dec 2023 08:52:16 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A6CB2166B32; Wed, 13 Dec 2023 08:52:16 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3BD8qD4R2489655 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 09:52:14 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3BD8qDMe2489654; Wed, 13 Dec 2023 09:52:13 +0100 Date: Wed, 13 Dec 2023 09:52:12 +0100 From: Jakub Jelinek To: Andrew Stubbs Cc: Tobias Burnus , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3 2/6] libgomp, openmp: Add ompx_pinned_mem_alloc Message-ID: Reply-To: Jakub Jelinek References: <20231211170405.2538247-1-ams@codesourcery.com> <20231211170405.2538247-3-ams@codesourcery.com> <587963ae-266b-41ea-be78-a3170972d068@codesourcery.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Tue, Dec 12, 2023 at 04:17:47PM +0000, Andrew Stubbs wrote: > On 12/12/2023 10:05, Tobias Burnus wrote: > > Hi Andrew, > > > > On 11.12.23 18:04, Andrew Stubbs wrote: > > > This creates a new predefined allocator as a shortcut for using pinned > > > memory with OpenMP.  The name uses the OpenMP extension space and is > > > intended to be consistent with other OpenMP implementations currently in > > > development. > > > > Discussed this with Jakub - and 9 does not permit to have a contiguous > > range of numbers if OpenMP ever extends this, > > > > Thus, maybe start the ompx_ with 100. > > These numbers are not defined in any standard, are they? omp_null_allocator is (it has to be zero), the others don't have value specified in the OpenMP standard, but it is an ABI thing. LLVM has omp_null_allocator = 0, omp_default_mem_alloc = 1, omp_large_cap_mem_alloc = 2, omp_const_mem_alloc = 3, omp_high_bw_mem_alloc = 4, omp_low_lat_mem_alloc = 5, omp_cgroup_mem_alloc = 6, omp_pteam_mem_alloc = 7, omp_thread_mem_alloc = 8, llvm_omp_target_host_mem_alloc = 100, llvm_omp_target_shared_mem_alloc = 101, llvm_omp_target_device_mem_alloc = 102, KMP_ALLOCATOR_MAX_HANDLE = UINTPTR_MAX and I think it is desirable to be ABI compatible here with the standard values. So, I think it is better to have one range for the standard ones (same values as other implementations) and another range for the extensions (and given that LLVM uses 100-102 range, perhaps pick a different one, 200 or 150). And then 2 tables, one for the standard range, one for the extensions. Jakub