From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by sourceware.org (Postfix) with ESMTPS id 071553858D28 for ; Wed, 18 Jan 2023 14:58:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 071553858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1674053899; bh=+dZouTbOLd+y68k8p2Llpu+N7EOiVS1h0VqUvF3F8tE=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=siVZxy5KZ2J0HWjPt50t6b/Vr+gnAE89Xe34Pg+0QfX3o99aHVkGuSGL3jyJTYxAf d9gyAOV3b4KEMtR4UygKSaJ9MWgMS7pl85lQI8+l7WfEg13xhHBdChTUfkPsWZ+o+r 4YL/g3PUJ5KnD/GlLwPMSOczDoRFGC9ye65hjiwur0bcOtRmIAFh5oaFWFIA3J1LMk 8z0ba+7vxG0MpBy+vq9IB6+UUCPtjcqFOPR8WKvN4m+DqPOljVc2OPEQhWyqgAkmNS zTIvvmMdBYxKZ7qqvDP7OagJ7RYfR9msPrnTa6H+ddtS30wKW4TZGniN+ss2NYPjLk pOZIN0PGWokAw== Received: from [172.16.0.101] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4NxpmC4msFzgym; Wed, 18 Jan 2023 09:58:19 -0500 (EST) Message-ID: <2c8ef9f3-731e-e07d-d589-9dea5e3a9972@efficios.com> Date: Wed, 18 Jan 2023 09:58:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [RFC/PoC] malloc: use wfcqueue to speed up remote frees Content-Language: en-US From: Mathieu Desnoyers To: Eric Wong , Carlos O'Donell Cc: libc-alpha@sourceware.org References: <20180731084936.g4yw6wnvt677miti@dcvr> <0cfdccea-d173-486c-85f4-27e285a30a1a@redhat.com> <20180731231819.57xsqvdfdyfxrzy5@whir> <20230117064251.M336757@dcvr> <084051cc-7ddb-eb66-3361-41a7eb79d959@efficios.com> In-Reply-To: <084051cc-7ddb-eb66-3361-41a7eb79d959@efficios.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 2023-01-18 09:53, Mathieu Desnoyers wrote: > On 2023-01-17 01:42, Eric Wong wrote: >> Carlos O'Donell wrote: >>>>> - Adding urcu as a build-time dependency is not acceptable for >>>>> bootstrap, instead we would bundle a copy of urcu and keep it >>>>> in sync with upstream. Would that make your work easier? >>> >>> Eric Wong wrote: >>>> Yes, bundling that sounds great.  I assume it's something for >>>> you or one of the regular contributors to work on (build systems >>>> scare me :x) >>> >>> Yes, that is something we'd have to do. >> >> Hi, bringing this topic from 2018 up again (+Cc Mathieu): >> https://inbox.sourceware.org/libc-alpha/c061de55-cc2a-88fe-564b-2ea9c4a7e632@redhat.com/T/ >> >> I'm wondering if URCU-in-glibc is still on the table.  I'm also >> considering an learning C11 atomics and deriving a standalone >> wfcqueue w/o URCU atomics. > > I've done a quick review of your proposed patch, and there is one thing > that I'm concerned about: forward progress of remote_free_finish(). > AFAIU, if we have a steady flow of remote_free_begin() calls, it can > prevent forward progress of the anena owner. > > When remote_free_step() captures the queue (splice) and processes it, it > returns whether it has processed any elements, and the caller attempts > to splice again if there was anything present. What I wonder is why is > it required that the caller splices queue elements that were queued > _after_ the begin of remote_free_finish() ? Can't we simply leave those > to the next (eventual) remote_free_finish calls ? > > If we do that change, this means remote_free_finish would only be needed > when tearing down an arena, and upon allocation only a single call to > remote_free_step() would be needed. > > Thoughts ? Well, nevermind, it appears that what I explain here (step in malloc, finish only when consolidation is needed) is exactly what your implementation does. It took me a more careful reading and a few more sips of morning coffee to get it. :) Thanks, Mathieu > > Thanks, > > Mathieu > -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com