From nobody Wed Oct 25 10:51:22 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SFm2H6T5Jz4yLZ2 for ; Wed, 25 Oct 2023 10:51:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFm2H28kdz3VHf for ; Wed, 25 Oct 2023 10:51:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.17.1/8.17.1) with ESMTP id 39PApMC6098926; Wed, 25 Oct 2023 13:51:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 39PApMC6098926 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 39PApMUs098925; Wed, 25 Oct 2023 13:51:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Oct 2023 13:51:22 +0300 From: Konstantin Belousov To: Marcin Cieslak Cc: FreeBSD Current Subject: Re: d_map_single - how should it work? Message-ID: References: <3639798o-57qp-8r14-n250-57520ssps48o@fncre.vasb> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3639798o-57qp-8r14-n250-57520ssps48o@fncre.vasb> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4SFm2H28kdz3VHf On Wed, Oct 25, 2023 at 07:58:41AM +0000, Marcin Cieslak wrote: > Hello, > > is there any documentation for cdevsw methods? > I am interested in knowing how d_map_single should > be written. > > Most specifically, I want to know if the driver > has a chance to track mmaped allocations on its own > (as far as I can see there unmap(2) does not call > any of the driver's methods). You need d_map_single + managed cdev pager to get something like that. You cannot get unmaps reported, only last reference drop is communicated. See struct cdev_pager_ops for an idea what is provided.