From owner-svn-src-head@freebsd.org Mon Jun 29 16:54:01 2020 Return-Path: Delivered-To: svn-src-head@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 4F57E34E2EA; Mon, 29 Jun 2020 16:54:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49wYVK1Pndz43yj; Mon, 29 Jun 2020 16:54:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 147D2A5E7; Mon, 29 Jun 2020 16:54:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05TGs0U7060434; Mon, 29 Jun 2020 16:54:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05TGs0qK060433; Mon, 29 Jun 2020 16:54:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202006291654.05TGs0qK060433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 29 Jun 2020 16:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362784 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 362784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2020 16:54:01 -0000 Author: cem Date: Mon Jun 29 16:54:00 2020 New Revision: 362784 URL: https://svnweb.freebsd.org/changeset/base/362784 Log: vm: Add missing WITNESS warnings for M_WAITOK allocation vm_map_clip_{end,start} and lookup_clip_start allocate memory M_WAITOK for !system_map vm_maps. Add WITNESS warning annotation for !system_map callers who may be holding non-sleepable locks. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25283 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jun 29 15:15:14 2020 (r362783) +++ head/sys/vm/vm_map.c Mon Jun 29 16:54:00 2020 (r362784) @@ -2379,6 +2379,11 @@ vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, { vm_map_entry_t new_entry; + if (!map->system_map) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "%s: map %p entry %p start 0x%jx", __func__, map, entry, + (uintmax_t)start); + if (start <= entry->start) return; @@ -2409,6 +2414,11 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta { vm_map_entry_t entry; + if (!map->system_map) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "%s: map %p start 0x%jx prev %p", __func__, map, + (uintmax_t)start, prev_entry); + if (vm_map_lookup_entry(map, start, prev_entry)) { entry = *prev_entry; vm_map_clip_start(map, entry, start); @@ -2430,6 +2440,11 @@ vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm { vm_map_entry_t new_entry; + if (!map->system_map) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "%s: map %p entry %p end 0x%jx", __func__, map, entry, + (uintmax_t)end); + if (end >= entry->end) return; @@ -3725,6 +3740,7 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs vm_map_entry_t entry, next_entry; VM_MAP_ASSERT_LOCKED(map); + if (start == end) return (KERN_SUCCESS);