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 898DB38323C2 for ; Fri, 21 Jun 2024 16:17:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 898DB38323C2 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 898DB38323C2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718986668; cv=none; b=cywwIz6NtpURJOho8I53m1gFDI0TiAPJ5Wc+fEOb8foaB8LhGcvHQ/e8hl+IAbKAgnEduNw7c7fab4MAi5F/z8iSFjzK7b461YWQ8CV4uhghROG6lFqjrmxLn7WJCJ+ozSkDqJGU9n0GN2nIBELjttX5o9z3jVRc8vmVc1vJ0E8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718986668; c=relaxed/simple; bh=EdasTr47Em96OyrDirE8GLFxIDTOm7xh3w6/GcQWzDQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JFSWBVJGzSS/pC0gTDmoPt0xAfzGALeQaMBCvfPiZOX66TTZar2t7/Qvgb1kf+ldH9PRNTgbYnCN92OMn0l/t2DRthEtZBQMK2dA9iidMFjnr5C9La1cVux/fRnmjsvmP4qtnKqT775CQjgp+DNUsi/4e+qISfEE/Zvlb+tRJhA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718986658; 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: in-reply-to:in-reply-to; bh=Em1Z5F3clgsxLreUq3Bx0ad/LI7qc60/qej0LYFLpbw=; b=OCKWZvETZ2a5F/byWcq8LWSt4qdtbMb3wmnVYAbuqak0pGCCO0eJVbtmDwOD9/HY5nRJxu FJsyktstlmfzxldAJjNJIa9GJ9QPBrHwYjb1v4igjW1dDzvbcSG3sIAhryTmnynkjjdsQZ JMLwIfUs7fD3Dgmt/cOYcDP1d+D4BK4= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-BapByKamOWaYO8thMmmQeQ-1; Fri, 21 Jun 2024 12:17:36 -0400 X-MC-Unique: BapByKamOWaYO8thMmmQeQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A249419560BC; Fri, 21 Jun 2024 16:17:35 +0000 (UTC) Received: from greed.delorie.com (unknown [10.22.8.61]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 204C11956087; Fri, 21 Jun 2024 16:17:34 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.16.1/8.16.1) with ESMTP id 45LGHSFA1701363; Fri, 21 Jun 2024 12:17:28 -0400 From: DJ Delorie To: Mathieu Desnoyers Cc: libc-alpha@sourceware.org Subject: Re: [v4] Update mmap() flags and errors lists In-Reply-To: <7b23e187-3d73-4eab-9ef6-c15679666676@efficios.com> (message from Mathieu Desnoyers on Fri, 21 Jun 2024 09:02:29 -0400) Date: Fri, 21 Jun 2024 12:17:28 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-1.9 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,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Mathieu Desnoyers writes: >>>> +@item MAP_SYNC >>>> +This flag is used to map persistent memory devices into the running >>>> +program in such a way that writes to the mapping are immediately >>>> +written to the device as well. Unlike most other flags, this one will >>>> +fail unless @code{MAP_SHARED_VALIDATE} is also given. >>> >>> Note that this wording is misleading. Users of persistent memory devices >>> need to issue explicit "flush" instructions to ensure that writes are >>> made persistent to the device. The MAP_SYNC merely guarantees that >>> memory mappings within a file on a dax-enabled filesystem will appear >>> at the same file offset after a crash/reboot. It goes not guarantee >>> anything about write persistence. >> >> "This flag is supported only for files supporting DAX (direct mapping >> of persistent memory)" >> >> "it will be visible in the same file at the same offset even after the >> system crashes or is rebooted." >> >> That sounds like persistence to me? > > AFAIU it states persistence of the mapping location within the file, but > it does not guarantee anything about persistence of the writes to that > mapping. > > In many cases, persistence of the writes to the mapping are only made > persistent after specific cache-flushing instructions have been issued. > > See this man page for reference: > > https://manpages.debian.org/experimental/libpmem-dev/pmem_flush.3 How about if I just say "This is a special flag for DAX devices." and not bother trying to be helpful? ;-) All the kernel does is write out dirty metadata whenever dirty data is written out, when the flag is set.