From nobody Fri May 06 11:59:08 2022 X-Original-To: dev-commits-src-main@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 63A391AB7D1F; Fri, 6 May 2022 11:59:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvpyB2BQzz4wNY; Fri, 6 May 2022 11:59:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651838354; 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:references:references; bh=heM3AQv/P+N1M0uVu6MLS2ZvJUAVPd0YownPTA1t050=; b=MOtjzvYE5ZmA/nDufZMrP1rZlozyE5Qw0PH0X76Yo0owVZG2Ip8vAtPoDRWm3iDh5C+KW/ 8WZX4sfyF6Ooz16g8LodGlhSfSZAQxFUwd1rgx1cvBoOvRmZPxkh0hf5Ubr8IZIjoDlYz6 rGpo/c2pOEE0OEVwtl7OsRJX1o4t5Y05dE/oMmfVDMre39Pld+3dwlJ8k05r5fYFL6jT1k cjQwXD8oWP46bDMev2tYAguMvudahoB6Wmf/TYH+Zpum2Ez/3yXq/Q1L9PdfPT43WHWmIo SQSfUG+sNPNMMn/cQey3HeuIqqJPInrKwPkZ+1e/3E/zKNlVKOvzamKWFZSkhQ== Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 102222CF7E; Fri, 6 May 2022 11:59:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id EE8F38D4A178; Fri, 6 May 2022 11:59:11 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 75AD5E707BA; Fri, 6 May 2022 11:59:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id IvjwdMbsNVAK; Fri, 6 May 2022 11:59:09 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 97401E707B6; Fri, 6 May 2022 11:59:09 +0000 (UTC) Date: Fri, 6 May 2022 11:59:08 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 92e40a9b9241 - main - busdma_bounce: Batch bounce page free operations when possible. In-Reply-To: <202204211902.23LJ2bug035892@gitrepo.freebsd.org> Message-ID: References: <202204211902.23LJ2bug035892@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651838354; 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:references:references; bh=heM3AQv/P+N1M0uVu6MLS2ZvJUAVPd0YownPTA1t050=; b=bgpQO5/lLyznLAfvblv8PEfQRJQ9YWPF2xZKK9KRc+QTwcX7lU1mHUiQhu0O6bbRoWOkPV Sz3sEgCoUSLqKG22gvOhzmYBtyvX1FIm2ohlLvl9XNfpzLSPRMtsdNodxRdqJP6RqC4ClA h/p32WBfo1R81hKbB6xFSosLCnqdrcqqzhiZ+LIYIgaG9lhvnQeISEMkTCE3OScslxZ7JC RSqsz+MSWn1NprHlCyIZeXmrmkUF/WoUPS/besWisznsuVMeUcUH+s/1To0hp0grlFyehp 5oShwYCCcF3U5ypJVPa8+CQO3HJl9f2Oj/oO1Cdj6+53V+nf2ht2gGl3UgNpKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651838354; a=rsa-sha256; cv=none; b=N3FRYpeji1Z2cochlOHizdl/m1I3/3rzaYdgLsdlFec9aQXtxffphnSJmoaGavdngpjgW4 hZQwusrD3zKV2/WMX9+0DTirNJsdV+3o99gXREAeBgJ3tyD0zWjykCwqQGfQmHQBE3mV99 4q0+0S/wBnzdL9zfl8h4rdCbP4/IAlHXavxJKiYEURl0xMGxB0mTPcugT01kxJtBGSB5yi AT7/SrBnb4Fy04w9Zk6Z8MEYeYfgSYuO4qqw8+l8o2FlkC2IegLC82eSsxKkRFDulY2mwm YfNV2/aKEkbMPrEYIvSkgpk8kvI8pqGRfoq7BppyLANnVQYSi0rezsI2APnUkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Thu, 21 Apr 2022, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=92e40a9b9241313b3d16543819ccd8d642bb11a5 > > commit 92e40a9b9241313b3d16543819ccd8d642bb11a5 > Author: John Baldwin > AuthorDate: 2022-04-21 19:01:55 +0000 > Commit: John Baldwin > CommitDate: 2022-04-21 19:01:55 +0000 > > busdma_bounce: Batch bounce page free operations when possible. > > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D34968 > --- > sys/kern/subr_busdma_bounce.c | 69 +++++++++++++++++++++---------------------- > 1 file changed, 34 insertions(+), 35 deletions(-) > > diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c > index 243da8e9487f..f3699cf2ad27 100644 > --- a/sys/kern/subr_busdma_bounce.c > +++ b/sys/kern/subr_busdma_bounce.c > @@ -382,55 +382,54 @@ add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, > } > > static void > -free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) > +free_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map) > { ... > mtx_lock(&bounce_lock); > - STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links); ... > + STAILQ_CONCAT(&bz->bounce_page_list, &map->bpages); This changes an aspect we had discussed in a different context of a change I had proposed to keep the pages ordered in order to fullfill multi-page nseg=1 requests better. In the new case your "possibly still cache hot" pages are no longer at the beginning of the bounce_page_list but at the end? If this is no longer considered to be an issue, contigous page space still is, so I wondere if a change to keep the pages ordered would be accepted more likely now? ... > -static void > -free_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map) > -{ > - struct bounce_page *bpage; > - > - while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { > - STAILQ_REMOVE_HEAD(&map->bpages, links); > - free_bounce_page(dmat, bpage); > - } > -} -- Bjoern A. Zeeb r15:7