From owner-svn-src-all@freebsd.org Wed Dec 7 01:18:24 2016 Return-Path: Delivered-To: svn-src-all@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 B8B02C69D2E; Wed, 7 Dec 2016 01:18:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 724A81E8; Wed, 7 Dec 2016 01:18:24 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id n6so42618775qtd.0; Tue, 06 Dec 2016 17:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yn9kstJyPePnzvITYwyynFC5F2hbcfUwwiCDJbOB4uU=; b=UzskcQ7Z6rpl9f1P18va3L0/okVSelkiJxxAmY0vqGdQQXKaTfGvTLJCZTe5s5eyho bcOZuxeuUTpgRg8QXa5bFxHLL/EXk6HgcrrCpFOniZkMHxT/xpoIGThh6AL+/PBTHR22 gvKSU2t0E9xpIm/beV+x3dkhY5ZRhZCBQm5Bj+4Nm2S24llJeHwRbi/0xkZmSGLwV4fL vwoxzf9LekCdz2s7eLhQ5xCJc2UTyTXOksqYvrTTb9EGEgW1/zxdXNNI3uTIrnI12Qeo Jna8qqVA+I19Px8UYU+THg+28arSQgBHR/ddfZ89Ar7OVCiF6HoKQCPbV+xbuAufUR/r NAtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yn9kstJyPePnzvITYwyynFC5F2hbcfUwwiCDJbOB4uU=; b=AYXjUOkeH22ThDlD1C6lcbCyhZSSoH+Z9G3//MQ3dsI/YQeaCmGP5UyBzE5/ZYJf9w SfEt/8RlumetKfdkveFBIj7f2jsGHsKjtlGmdw+sJS4idgtu7FD33kYvmMoyq/cAo6C3 pA7DWLQKvYRVXVttYfTxyHRWSF6r9VUfaM3didG8z9tYj7RGDmQkrUFMd8hnDWRdtE5E aV5EIQbfFBiRSGW5mnHiIHlyyK1MHLPzJz7jiLOf2l5VkmNwfLtc+n+i65EU3aN99ogq 0014Y1EXeQPjygd2Qe9buwV/jh9z9LHzQOys8ehjM5SXLjkrXMoufD/wfIe7BwRCdLZw U2dQ== X-Gm-Message-State: AKaTC03ZC1gF4bO0SCpxkT4kzToJR1OpE7ez7J+V6IKNRIj0bCUgDoJx76+kdyVW0Clv8A== X-Received: by 10.237.63.75 with SMTP id q11mr65578576qtf.189.1481073502929; Tue, 06 Dec 2016 17:18:22 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id u13sm13538766qtc.37.2016.12.06.17.18.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 17:18:22 -0800 (PST) Sender: Mark Johnston Date: Tue, 6 Dec 2016 17:24:13 -0800 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309658 - head/sys/vm Message-ID: <20161207012413.GA47261@wkstn-mjohnston.west.isilon.com> References: <201612062252.uB6Mqjhr019191@repo.freebsd.org> <20161207110947.V1119@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161207110947.V1119@besplex.bde.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 01:18:24 -0000 On Wed, Dec 07, 2016 at 11:44:49AM +1100, Bruce Evans wrote: > On Tue, 6 Dec 2016, Mark Johnston wrote: > > > Log: > > Provide dummy sysctls for v_cache_count and v_tcached. > > > > Some utilities (notably top(1)) exit if any of their input sysctls don't > > exist, and the removal of the above-mentioned PG_CACHE-related sysctls > > makes it difficult to run such utilities on different versions of the > > kernel without recompiling. > > > > Requested by: bde > > Thanks. > > > Modified: head/sys/vm/vm_meter.c > > ============================================================================== > > --- head/sys/vm/vm_meter.c Tue Dec 6 22:48:28 2016 (r309657) > > +++ head/sys/vm/vm_meter.c Tue Dec 6 22:52:45 2016 (r309658) > > @@ -314,3 +314,14 @@ VM_STATS_VM(v_forkpages, "VM pages affec > > VM_STATS_VM(v_vforkpages, "VM pages affected by vfork()"); > > VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); > > VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); > > + > > +#ifndef BURN_BRIDGES > > +/* > > + * Provide compatibility sysctls for the benefit of old utilities which exit > > + * with an error if they cannot be found. > > + */ > > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTLFLAG_RD, > > + (u_int *)NULL, 0, "Dummy for compatibility"); > > +SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, > > + (u_int *)NULL, 0, "Dummy for compatibility"); > > +#endif > > I don't like casting NULL, but SYSCTL_* enforces type safety for pointers > to variables in a way that breaks normal use of NULL. > > You are supposed to obfuscate this by spelling the value as SYSCTL_UINT_NULL. > This is actually documented in sysctl(9). Fixed, thanks - I somehow managed to miss those #defines when I was looking at sysctl.h to see why a plain "NULL" doesn't work there.