From 04909c8c9ef61a86dd44bdaf341a1d9a2f0206e5 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 2 Mar 2018 17:34:28 +0000 Subject: 12608 want memory arena for vmm applications 12609 x86 memory DR should be disabled Reviewed by: Jerry Jelinek Reviewed by: Patrick Mooney Reviewed by: Toomas Soome Approved by: Gordon Ross --- usr/src/cmd/mdb/common/modules/genunix/memory.c | 35 ++++++++++++------------- 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'usr/src/cmd/mdb/common/modules/genunix') diff --git a/usr/src/cmd/mdb/common/modules/genunix/memory.c b/usr/src/cmd/mdb/common/modules/genunix/memory.c index 3810c9e506..d5ffa1537a 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/memory.c +++ b/usr/src/cmd/mdb/common/modules/genunix/memory.c @@ -443,11 +443,11 @@ vn_get(vn_htable_t *hp, struct vnode *vp, uintptr_t ptr) /* Summary statistics of pages */ typedef struct memstat { - struct vnode *ms_kvp; /* Cached address of kernel vnode */ struct vnode *ms_unused_vp; /* Unused pages vnode pointer */ - struct vnode *ms_zvp; /* Cached address of zio vnode */ + struct vnode *ms_kvps; /* Cached address of vnode array */ uint64_t ms_kmem; /* Pages of kernel memory */ uint64_t ms_zfs_data; /* Pages of zfs data */ + uint64_t ms_vmm_mem; /* Pages of VMM mem */ uint64_t ms_anon; /* Pages of anonymous memory */ uint64_t ms_vnode; /* Pages of named (vnode) memory */ uint64_t ms_exec; /* Pages of exec/library memory */ @@ -458,11 +458,8 @@ typedef struct memstat { struct vnode ms_vn; /* vnode buffer */ } memstat_t; -#define MS_PP_ISKAS(pp, stats) \ - ((pp)->p_vnode == (stats)->ms_kvp) - -#define MS_PP_ISZFS_DATA(pp, stats) \ - (((stats)->ms_zvp != NULL) && ((pp)->p_vnode == (stats)->ms_zvp)) +#define MS_PP_ISTYPE(pp, stats, index) \ + ((pp)->p_vnode == &(stats->ms_kvps[index])) /* * Summarize pages by type and update stat information @@ -478,10 +475,12 @@ memstat_callback(page_t *page, page_t *pp, memstat_t *stats) stats->ms_bootpages++; else if (pp->p_vnode == NULL || pp->p_vnode == stats->ms_unused_vp) return (WALK_NEXT); - else if (MS_PP_ISKAS(pp, stats)) + else if (MS_PP_ISTYPE(pp, stats, KV_KVP)) stats->ms_kmem++; - else if (MS_PP_ISZFS_DATA(pp, stats)) + else if (MS_PP_ISTYPE(pp, stats, KV_ZVP)) stats->ms_zfs_data++; + else if (MS_PP_ISTYPE(pp, stats, KV_VVP)) + stats->ms_vmm_mem++; else if (PP_ISFREE(pp)) stats->ms_cachelist++; else if (vn_get(stats->ms_vn_htable, vp, (uintptr_t)pp->p_vnode)) @@ -507,7 +506,6 @@ memstat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) memstat_t stats; GElf_Sym sym; vn_htable_t ht; - struct vnode *kvps; uintptr_t vn_size = 0; #if defined(__i386) || defined(__amd64) bln_stats_t bln_stats; @@ -548,16 +546,10 @@ memstat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) /* read kernel vnode array pointer */ if (mdb_lookup_by_obj(MDB_OBJ_EXEC, "kvps", (GElf_Sym *)&sym) == -1) { - mdb_warn("unable to read kvps"); + mdb_warn("unable to look up kvps"); return (DCMD_ERR); } - kvps = (struct vnode *)(uintptr_t)sym.st_value; - stats.ms_kvp = &kvps[KV_KVP]; - - /* - * Read the zio vnode pointer. - */ - stats.ms_zvp = &kvps[KV_ZVP]; + stats.ms_kvps = (struct vnode *)(uintptr_t)sym.st_value; /* * If physmem != total_pages, then the administrator has limited the @@ -605,6 +597,13 @@ memstat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) MS_PCT_TOTAL(stats.ms_zfs_data)); } + if (stats.ms_vmm_mem != 0) { + mdb_printf("VMM Memory %16llu %16llu %3lu%%\n", + stats.ms_vmm_mem, + (uint64_t)stats.ms_vmm_mem * PAGESIZE / (1024 * 1024), + MS_PCT_TOTAL(stats.ms_vmm_mem)); + } + mdb_printf("Anon %16llu %16llu %3lu%%\n", stats.ms_anon, (uint64_t)stats.ms_anon * PAGESIZE / (1024 * 1024), -- cgit v1.2.3 From 88d6421c15f1c4daea9c8128e715662091258054 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Fri, 22 May 2020 01:03:27 +0000 Subject: 12779 mdb str_flags is missing STRXPG4TTY Reviewed by: Andrew Stormont Reviewed by: Toomas Soome Approved by: Dan McDonald --- usr/src/cmd/mdb/common/modules/genunix/streams.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr/src/cmd/mdb/common/modules/genunix') diff --git a/usr/src/cmd/mdb/common/modules/genunix/streams.c b/usr/src/cmd/mdb/common/modules/genunix/streams.c index 245fca6070..7f18b59f23 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/streams.c +++ b/usr/src/cmd/mdb/common/modules/genunix/streams.c @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + */ + #include #include @@ -147,7 +151,7 @@ static const struct str_flags stdf[] = { { SF(STRCLOSE), "wait for a close to complete" }, { SF(SNDMREAD), "used for read notification" }, { SF(OLDNDELAY), "use old NDELAY TTY semantics" }, - { SF(0x00020000), "unused" }, + { SF(STRXPG4TTY), "Use XPG4 TTY semantics" }, { SF(0x00040000), "unused" }, { SF(STRTOSTOP), "block background writes" }, { SF(STRCMDWAIT), "someone is doing an _I_CMD" }, -- cgit v1.2.3