Skip to content

Commit

Permalink
[illumos-gate merge]
Browse files Browse the repository at this point in the history
commit 40fc84a
    16079 rsrvrctl could be consistent with memory size units
    15561 VMM reservoir block comment is misleading about total reservoir limit
commit 516334b
    15970 SMB2 QueryInfoFile level FileAllInformation could be more efficient
  • Loading branch information
danmcd committed Nov 23, 2023
2 parents d042da7 + 40fc84a commit a311ee2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
19 changes: 11 additions & 8 deletions usr/src/cmd/rsrvrctl/rsrvrctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ usage(int exitcode)
exit(exitcode);
}

/*
* Parse an input size of MiB to bytes.
*/
static bool
parse_size(const char *arg, size_t *resp)
{
Expand Down Expand Up @@ -156,14 +159,14 @@ do_query(int fd)
return;
}

printf("Free KiB:\t%zu\n"
"Allocated KiB:\t%zu\n"
"Transient Allocated KiB:\t%zu\n"
"Size limit KiB:\t%zu\n",
data.vrq_free_sz / 1024,
data.vrq_alloc_sz / 1024,
data.vrq_alloc_transient_sz / 1024,
data.vrq_limit / 1024);
printf("Free MiB:\t%zu\n"
"Allocated MiB:\t%zu\n"
"Transient Allocated MiB:\t%zu\n"
"Size limit MiB:\t%zu\n",
data.vrq_free_sz / (1024 * 1024),
data.vrq_alloc_sz / (1024 * 1024),
data.vrq_alloc_transient_sz / (1024 * 1024),
data.vrq_limit / (1024 * 1024));
}

int
Expand Down
27 changes: 12 additions & 15 deletions usr/src/uts/common/fs/smbsrv/smb2_qinfo_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/*
* Copyright 2019 Nexenta by DDN, Inc. All rights reserved.
* Copyright 2022 RackTop Systems, Inc.
* Copyright 2022-2023 RackTop Systems, Inc.
*/

/*
Expand All @@ -25,7 +25,6 @@
#include <smbsrv/smb_fsops.h>
#include <smbsrv/ntifs.h>

static uint32_t smb2_qif_all(smb_request_t *, smb_queryinfo_t *);
static uint32_t smb2_qif_basic(smb_request_t *, smb_queryinfo_t *);
static uint32_t smb2_qif_standard(smb_request_t *, smb_queryinfo_t *);
static uint32_t smb2_qif_internal(smb_request_t *, smb_queryinfo_t *);
Expand All @@ -48,6 +47,12 @@ static uint32_t smb2_qif_opens(smb_request_t *, smb_queryinfo_t *);
static uint32_t smb2_qif_tags(smb_request_t *, smb_queryinfo_t *);
static uint32_t smb2_qif_id_info(smb_request_t *, smb_queryinfo_t *);

/*
* MS-SMB2 3.3.5.20.1 says (in a windows behavior note) that
* 2012R2 and older fill in the FileNameInformation.
* Default to the new behavior.
*/
boolean_t smb2_qif_all_get_name = B_FALSE;

uint32_t
smb2_qinfo_file(smb_request_t *sr, smb_queryinfo_t *qi)
Expand Down Expand Up @@ -75,10 +80,8 @@ smb2_qinfo_file(smb_request_t *sr, smb_queryinfo_t *qi)
case FileAllInformation:
mask = SMB_AT_ALL;
getstd = B_TRUE;
if (sr->session->dialect < SMB_VERS_3_11) {
/* See smb2_qif_all() */
if (smb2_qif_all_get_name)
getname = B_TRUE;
}
break;

case FileNameInformation:
Expand Down Expand Up @@ -244,18 +247,12 @@ smb2_qif_all(smb_request_t *sr, smb_queryinfo_t *qi)
if (status)
return (status);

/*
* MS-SMB2 3.3.5.20.1 says (in a windows behavior note) that
* 2012R2 and older fill in the FileNameInformation.
* We could let this depend on sr->sr_cfg->skc_version
* but doing it based on dialect is a lot easier and
* has nearly the same effect.
*/
if (sr->session->dialect < SMB_VERS_3_11) {
/* Win2012r2 and earlier fill it in. (SMB 3.0) */
/* See smb2_qif_all_get_name */
if (qi->qi_namelen != 0) {
/* Win2012r2 and earlier fill it in. */
status = smb2_qif_name(sr, qi);
} else {
/* Win2016 and later just put zeros (SMB 3.11) */
/* Win2016 and later just put zeros. */
int rc = smb_mbc_encodef(&sr->raw_data, "10.");
status = (rc == 0) ? 0 : NT_STATUS_BUFFER_OVERFLOW;
}
Expand Down
13 changes: 7 additions & 6 deletions usr/src/uts/intel/io/vmm/vmm_reservoir.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@
*
* Operators may attempt to alter the amount of memory allocated to the
* reservoir via an ioctl against the vmmctl device. The total amount of memory
* in the reservoir (free, or allocated to VMs) is arbitrarily limited at this
* time by `vmmr_total_limit`, which defaults to 80% of physmem. This is done
* to prevent the reservoir from inadvertently growing to a size where the
* system has inadequate memory to make forward progress. Shrinking the
* reservoir is only possible when it contains free (not allocated by any guest
* VMs) memory.
* in the reservoir (free, or allocated to VMs) is limited by
* `vmm_total_limit` (see its definition for how this limit is calculated).
*
* The limit is in place to prevent the reservoir from inadvertently growing
* to a size where the system has inadequate memory to make forward progress.
* Shrinking the reservoir is only possible when it contains free (not
* allocated by any guest VMs) memory.
*
*
* Page Tracking
Expand Down

0 comments on commit a311ee2

Please sign in to comment.