From nobody Mon Jan 29 13:12:34 2024 X-Original-To: freebsd-hackers@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 4TNpcq5Q4mz58gyp for ; Mon, 29 Jan 2024 13:12:43 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 4TNpcq0yMwz4Gjn for ; Mon, 29 Jan 2024 13:12:42 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-91-49.area1b.commufa.jp [123.1.91.49]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 40TDCZk0043077; Mon, 29 Jan 2024 22:12:35 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Mon, 29 Jan 2024 22:12:34 +0900 From: Tomoaki AOKI To: void Cc: freebsd-hackers@freebsd.org Subject: Re: arm64 swap-related question Message-Id: <20240129221234.657f47be4718f7c894801cac@dec.sakura.ne.jp> In-Reply-To: References: Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4TNpcq0yMwz4Gjn 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:7684, ipnet:153.125.128.0/18, country:JP] On Mon, 29 Jan 2024 12:48:21 +0000 void wrote: > Hello, > > What's the default granularity with swapping on recent -current > on arm64? > > ie. whats the smallest size of data that is swapped out. 1k? 4k? Where > can I find this info? Can it be set/tuned? How to see what it currently is? > I'd like to set it to 32k if possible. Read performance on this disk > for swap tops out at 60MB/s with a 32k block size. > > For bs=512 it's 1349 kB/s > For bs=4k it's 11MB/s > > context: the thing I'm trying to work around is poor swap performance > on this arch/hardware. > -- You should read /usr/src/sys/vm/swap_pager.c. Keyword would PAGE_SIZE. Then, look for its definition for arm64. IIUC, swap is based on "paging" and once severe memory shortage happens, swap out whole idle but not pinned processes with per-process basis, and when it's not sufficient to keep OS running, OOM killer whould look for which process to kill. So PAGE_SIZE shold be the keyword for it. HTH. -- Tomoaki AOKI