From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 627831F8C6 for ; Fri, 3 Sep 2021 22:16:45 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B7674384783E for ; Fri, 3 Sep 2021 22:16:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7674384783E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630707403; bh=xkUA5VHrEId18JQDS6F8cHxHpS19QgBoeXExNincPCE=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TEKVgdaB9BkRaiMdcZR0AeJyeZYnWA7hX/WTYw6X280WW5czzlfztGfg7iHMAJNej entUo3br/lpwoUOuU9CNjDxAZnQGyrESmyp7tQfPLligCVYLUCwuwV9RH8PgG0h9CI qohPa/L7ZT9PCfNkUaUTvtgMRz8EDvuNfEXecq7c= Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by sourceware.org (Postfix) with ESMTPS id 43EEF3848415 for ; Fri, 3 Sep 2021 22:16:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43EEF3848415 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4H1XDK3Sdmz1DGXt; Sat, 4 Sep 2021 06:15:29 +0800 (CST) Received: from dggemi709-chm.china.huawei.com (10.3.20.108) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Sat, 4 Sep 2021 06:16:15 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggemi709-chm.china.huawei.com (10.3.20.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Sat, 4 Sep 2021 06:16:14 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2308.008; Sat, 4 Sep 2021 06:16:15 +0800 To: Huang Shijie , Florian Weimer Subject: RE: [PATCH] Add LD_NUMA_REPLICATION for glibc Thread-Topic: [PATCH] Add LD_NUMA_REPLICATION for glibc Thread-Index: AQHXoNaLIDPd6kWWt0CtjlSjT9ni+auS3vng Date: Fri, 3 Sep 2021 22:16:14 +0000 Message-ID: References: <20210903121434.12162-1-shijie@os.amperecomputing.com> <87bl5a6ul2.fsf@oldenburg.str.redhat.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.200.215] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Song Bao Hua \(Barry Song\) via Libc-alpha" Reply-To: "Song Bao Hua \(Barry Song\)" Cc: Huang Shijie via Libc-alpha , "zwang@amperecomputing.com" , "willy@infradead.org" , "linux-mm@kvack.org" , "viro@zeniv.linux.org.uk" , "patches@amperecomputing.com" , "torvalds@linux-foundation.org" , "akpm@linux-foundation.org" Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" > -----Original Message----- > From: Huang Shijie [mailto:shijie@os.amperecomputing.com] > Sent: Saturday, September 4, 2021 3:16 AM > To: Florian Weimer > Cc: Huang Shijie via Libc-alpha ; > carlos@systemhalted.org; zwang@amperecomputing.com; > patches@amperecomputing.com; akpm@linux-foundation.org; > torvalds@linux-foundation.org; viro@zeniv.linux.org.uk; willy@infradead.o= rg; > Song Bao Hua (Barry Song) ; linux-mm@kvack.or= g > Subject: Re: [PATCH] Add LD_NUMA_REPLICATION for glibc >=20 > On Fri, Sep 03, 2021 at 08:28:57AM +0200, Florian Weimer wrote: > > * Huang Shijie via Libc-alpha: > > > > > This patch adds LD_NUMA_REPLICATION which influences the linkage of s= hared > libraries at run time. > > > > > > If LD_NUMA_REPLICATION is set for program foo like this: > > > #LD_NUMA_REPLICATION=3D1 ./foo > > > > > > At the time ld.so mmaps the shared libraries, it will uses > > > mmap(, c->prot | PROT_WRITE, MAP_COPY | MAP_FILE | MAP_POPULATE,) > > > for them, and the mmap will trigger COW(copy on write) for the shared > > > libraries at the NUMA node which the program `foo` runs. After the > > > COW, the foo will have a copy of the shared library segment(mmap > > > covered) which belong to the same NUMA node. > > > > > > So when enable LD_NUMA_REPLICATION, it will consume more memory, > > > but it will reduce the remote-access in NUMA. > > > > I think the kernel could do this in a much better way, avoiding > > duplicating the pages within the same NUMA node. > I think maybe only the per-NUMA-node page cache can avoid it.. >=20 > > > > The other issue is the temporary RWX mapping, which does not > > interoperate well with some security hardening features. > > > Thanks for the feedback. > I CC more people who may have interesting about this. >=20 Hi Shijie, Thanks! Could we have some benchmark data for this patch? I assume it will benefit frontend-bound large workset which might face relatively more icache miss? >=20 > Thanks > Huang Shijie Thanks Barry