From owner-freebsd-current@freebsd.org Mon Aug 21 17:48:16 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A74F7DEAC38 for ; Mon, 21 Aug 2017 17:48:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 868487DA3D for ; Mon, 21 Aug 2017 17:48:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-68-135-200.dyn.iinet.net.au [106.68.135.200]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v7LHmBGT000902 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 21 Aug 2017 10:48:14 -0700 (PDT) (envelope-from julian@freebsd.org) To: freebsd-current From: Julian Elischer Subject: assigning priorities to swap partitions? Message-ID: Date: Tue, 22 Aug 2017 01:48:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2017 17:48:16 -0000 On an AZURE system there is a "local" device that is useful as swap. It is, I believe, faster than regular network based storage, but it is ephemeral, and may go away during a shutdown. It is in some machines a bit small so we'd like to add a bit more for safety. But we would like the ephemeral local storage to be used first. Can this be done at all? I can't see anything The last time I checked all swap was used in some balanced way. (the manual says so) One solution is to have a small cron job that only creates the added swap partition when the first one is (say) 70% full, but it'd be nice if there were some less hackish way. Another would be to occasionally wake up, and if the swap in use would all fit into the device we would like to be used, we do a swapoff on the other and force everything to be put on the fast drive..  but that sort of defeats the purpose as it's doing extra work.. Has anyone done any work on adding priority to swap? Julian