From owner-freebsd-current@freebsd.org Sun Apr 4 14:45:55 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 493EC5A92A9 for ; Sun, 4 Apr 2021 14:45:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FCxRl1BJzz3JL1 for ; Sun, 4 Apr 2021 14:45:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id i9so9467431qka.2 for ; Sun, 04 Apr 2021 07:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zbXDTQ3cuLUmIlW6FlcDAa8L8X6BO6U+wit4B11i19s=; b=DAofhnEby9KybTXtmEW6w7CQNU9JMGSZVnBgLAL+Up6hMMFE7DXxpXBNt1RnFmfSo0 gDgoC/f0DxMwa2ewvsIw3GXhFDCJRylFxwBiFQMJaOA8Qb86SBu9Ce/7clpggOp/9jw/ CVJ427GPc6bWv8ni2bWoqhK7k7JaqOhO9t7LXW2mVfgpcSPEKsMbskLHNFZthpHk1L/O hY9+aNKybv/JiFEFxTWJ28nWKZsdteMT6FjPJf+snDu4h3uhCElDkm+cTGOeNK/zC0ZP nsHkZg0+iUAVRpvZ/rBMHwCHwrquy3TePZ4buBX3gRKbTnIVpYG3UwnMxUfyH2oGVBa6 J2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zbXDTQ3cuLUmIlW6FlcDAa8L8X6BO6U+wit4B11i19s=; b=ij7QLVr79quHHm1cl2e+RV09MGYOkj3zoApk32NLCiPMyBCC4pzIgKdMdMuigCrqz0 ZR3vKLNHErYhxdNcuuFHE3aA5iROS3xGIXvE4QfSayRaqirH/0oZk+BtEPAqF0XWL1NV 9eb+ScBBWoWjDuv4MB7zR7LLNxpz6v+n5rQklJprSr8fdjLnElZ+bNK3iDp5xaPeMns9 wOKbSw/5kfvRs2NnAzE6nnn4hSHIyd78T/Sb9ntGIpADxb55Uc5fNvFdtJN/nkN5GPEC RbP0OKqShEZ2ZoqUK155mNjJeKryeYVuxkjP7aCkq8J5osdTCu6xBLuIYSK78Yi3fO47 CqCQ== X-Gm-Message-State: AOAM533+yVV2R5FmBF8edR465n9IpUbQi70ttWTeRvuvFJYfO0Z86M0u etknuFFWYnBTT9kA2mlMKEMpIB4vwr3fEEAgS7kOow== X-Google-Smtp-Source: ABdhPJytZzw3qHAaVBqzm3D1HjMU8lK3sIN6mC62wrTmYR6/T+ZhC3p6jrz3xVOwnNnBzYd8rubbz4son9I8w6E0PIk= X-Received: by 2002:a37:a845:: with SMTP id r66mr20475660qke.89.1617547553939; Sun, 04 Apr 2021 07:45:53 -0700 (PDT) MIME-Version: 1.0 References: <58bea0f0-5c3d-4263-ebee-f939a7e169e9@freebsd.org> <494d4aab-487b-83c9-03f3-10cf470081c5@freebsd.org> <81671.1617432659@critter.freebsd.dk> In-Reply-To: From: Warner Losh Date: Sun, 4 Apr 2021 08:45:41 -0600 Message-ID: Subject: Re: [SOLVED] Re: Strange behavior after running under high load To: Mateusz Guzik Cc: Poul-Henning Kamp , FreeBSD CURRENT X-Rspamd-Queue-Id: 4FCxRl1BJzz3JL1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 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: Sun, 04 Apr 2021 14:45:55 -0000 On Sun, Apr 4, 2021, 5:51 AM Mateusz Guzik wrote: > On 4/3/21, Poul-Henning Kamp wrote: > > -------- > > Mateusz Guzik writes: > > > >> It is high because of this: > >> msleep(&vnlruproc_sig, &vnode_list_mtx, PVFS, "vlruwk", > >> hz); > >> > >> i.e. it literally sleeps for 1 second. > > > > Before the line looked like that, it slept on "lbolt" aka "lightning > > bolt" which was woken once a second. > > > > The calculations which come up with those "constants" have always > > been utterly bogus math, not quite "square-root of shoe-size > > times sun-angle in Patagonia", but close. > > > > The original heuristic came from university environments with tons of > > students doing assignments and nethack behind VT102 terminals, on > > filesystems where files only seldom grew past 100KB, so it made sense > > to scale number of vnodes to how much RAM was in the system, because > > that also scaled the size of the buffer-cache. > > > > With a merged VM buffer-cache, whatever validity that heuristic had > > was lost, and we tweaked the bogomath in various ways until it > > seemed to mostly work, trusting the users for which it did not, to > > tweak things themselves. > > > > Please dont tweak the Finagle Constants again. > > > > Rip all that crap out and come up with something fundamentally better. > > > > Some level of pacing is probably useful to control total memory use -- > there can be A LOT of memory tied up in mere fact that vnode is fully > cached. imo the thing to do is to come up with some watermarks to be > revisited every 1-2 years and to change the behavior when they get > exceeded -- try to whack some stuff but in face of trouble just go > ahead and alloc without sleep 1. Should the load spike sort itself > out, vnlru will slowly get things down to the watermark. If the > watermark is too low, maybe it can autotune. Bottom line is that even > with the current idea of limiting preferred total vnode count, the > corner case behavior can be drastically better suffering SOME perf > loss from recycling vnodes, but not sleeping for a second for every > single one. > I'd suggest that going directly to a PID to control this would be better than the watermarks. That would give a smoother response than high/low watermarks would. While you'd need some level to keep things at still, the laundry stuff has shown the precise level of that level is less critical than the watermarks. Warner I think the notion of 'struct vnode' being a separately allocated > object is not very useful and it comes with complexity (and happens to > suffer from several bugs). > > That said, the easiest and safest thing to do in the meantime is to > bump the limit. Perhaps the sleep can be whacked as it is which would > largely sort it out. > > -- > Mateusz Guzik > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >