Linux Kernel 6.0 CXL Core pci.c 详解

news2024/11/27 6:38:12

文章目录

    • 前言
    • 相关链接
    • Ref
    • 正文

前言

CXL 是一个比较新的技术,所以我研究的内核源码是选了当前比较新的内核版本 linux 6.0。打算将内核关于 CXL 的驱动进行解析一遍,一步一步慢慢来。

在阅读之前,希望读者能有一定的 PCIe 基础知识,精力有限,不能把所有知识点都能说的很详细,需要一定的基础才能理解,同时,希望在学习的过程中,手边能有 PCIe 5.0 Spec 以及 CXL 2.0 Spec,以便随时查看,当然,我也会尽量把重点的部分截图在博文中。

最后,如果有问题请留言讨论。

相关链接

Linux Kernel 6.0 CXL Core Regs.c 详解

Ref

《PCI_Express_Base_5.0r1.0》
《CXL Specification_rev2p0_ver1p0_2020Oct26》

正文

首先,仍然是是一个PCI 设备驱动模型,根据 pci_device_id 中的 Class 去匹配设备,匹配成功调用 probe 函数


static const struct pci_device_id cxl_mem_pci_tbl[] = {
	/* PCI class code for CXL.mem Type-3 Devices */
	{ PCI_DEVICE_CLASS((PCI_CLASS_MEMORY_CXL << 8 | CXL_MEMORY_PROGIF), ~0)},
	{ /* terminate list */ },
};
MODULE_DEVICE_TABLE(pci, cxl_mem_pci_tbl);

static struct pci_driver cxl_pci_driver = {
	.name			= KBUILD_MODNAME,
    // 匹配表
	.id_table		= cxl_mem_pci_tbl,
    // 匹配成功,回调 probe 函数
	.probe			= cxl_pci_probe,
	.driver	= {
		.probe_type	= PROBE_PREFER_ASYNCHRONOUS,
	},
};

以下对 probe 函数进行解析:


static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
	struct cxl_register_map map;
	struct cxl_memdev *cxlmd;
	struct cxl_dev_state *cxlds;
	int rc;

	/*
	 * Double check the anonymous union trickery in struct cxl_regs
	 * FIXME switch to struct_group()
	 */
	BUILD_BUG_ON(offsetof(struct cxl_regs, memdev) !=
		     offsetof(struct cxl_regs, device_regs.memdev));

    // 使能设备
	rc = pcim_enable_device(pdev);
	if (rc)
		return rc;
    // 为 struct cxl_dev_state *cxlds 申请内存并初始化部分变量
	cxlds = cxl_dev_state_create(&pdev->dev);
	if (IS_ERR(cxlds))
		return PTR_ERR(cxlds);

    // Looks up the PCI_EXT_CAP_ID_DSN and reads the 8 bytes of the Device Serial Number.
    // The Device Serial Number is two dwords offset 4 bytes from the capability position
    // 在 PCIe Ext capability 中寻找序列号的位置并读出,详情参考 PCIe Spec
	cxlds->serial = pci_get_dsn(pdev);

    // 此函数会在 PCIe 配置空间中 extended capability 区域进行遍历
	// 寻找匹配的 Vendor == PCI_DVSEC_VENDOR_ID_CXL (0x23)
	// 以及 DVSEC ID == CXL_DVSEC_PCIE_DEVICE(0)的 DVSEC 
	// 0x23 是表示这个 capability 是 DVSEC 
	// 0 表示这个 DVSEC 是具体类型 DVSEC FOR CXL DEVICE
	// DVSEC 不了解的可以认为是一块保存一些寄存器的内存区域
	// 详情 Ref PCIe 5.0 Spec 7.9.6 Designated Vendor-Specific Extended Capability (DVSEC)
	// ID 分配 Ref CXL 2.0 Spec 8.1.1 PCI Express Designated Vendor-Specific Extended Capability(DVSEC) ID Assignment
	cxlds->cxl_dvsec = pci_find_dvsec_capability(
		pdev, PCI_DVSEC_VENDOR_ID_CXL, CXL_DVSEC_PCIE_DEVICE);
	if (!cxlds->cxl_dvsec)
		dev_warn(&pdev->dev,
			 "Device DVSEC not present, skip CXL.mem init\n");

	rc = cxl_setup_regs(pdev, CXL_REGLOC_RBI_MEMDEV, &map);
	if (rc)
		return rc;

	rc = cxl_map_regs(cxlds, &map);
	if (rc)
		return rc;

	/*
	 * If the component registers can't be found, the cxl_pci driver may
	 * still be useful for management functions so don't return an error.
	 */
	cxlds->component_reg_phys = CXL_RESOURCE_NONE;
	// 定位寄存器块位置,建立映射,记录位置和大小,详情在下面
	rc = cxl_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT, &map);
	if (rc)
		dev_warn(&pdev->dev, "No component registers (%d)\n", rc);

	// CXL_REGLOC_RBI_COMPONENT
	// Component 寄存器块的物理基地址
	cxlds->component_reg_phys = cxl_regmap_to_base(pdev, &map);

	// 为每个 DOE 创建一个实体
	devm_cxl_pci_create_doe(cxlds);

	// 查看 mailbox 是否准备好,记录 payload size 等信息
	rc = cxl_pci_setup_mailbox(cxlds);
	if (rc)
		return rc;

	// Enumerate commands for a device.
	// 详情见另一篇 mbox.c
	rc = cxl_enumerate_cmds(cxlds);
	if (rc)
		return rc;

	// Send the IDENTIFY command to the device.
	// 详情见另一篇 mbox.c
	// 命令作用 : Retrieve basic information about the memory device.,如 total_bytes、volatile_only_bytes等
	rc = cxl_dev_state_identify(cxlds);
	if (rc)
		return rc;
	// 创建内存范围信息
	// 详情见另一篇 mbox.c
	rc = cxl_mem_create_range_info(cxlds);
	if (rc)
		return rc;
	// 创建字符设备, /dev/memX
	// 详情见 memdev.c
	cxlmd = devm_cxl_add_memdev(cxlds);
	if (IS_ERR(cxlmd))
		return PTR_ERR(cxlmd);

	if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM))
		rc = devm_cxl_add_nvdimm(&pdev->dev, cxlmd);

	return rc;
}

1. CXL Subsystem Component Register Ranges

请添加图片描述

2. Type:

请添加图片描述


static int cxl_setup_regs(struct pci_dev *pdev, enum cxl_regloc_type type,
			  struct cxl_register_map *map)
{
	int rc;
	// Locate register blocks by type
	// 根据 Type 定位寄存器,记录寄存器的所在的BAR,偏移以及寄存器类型,保存在 map 中
	// CXL 设备有一些 CXL 相关的寄存器会以这种形式告知操作系统它的布局位置
	// Type 分为 (如上图)
	// 0 :空
	// 1 :Component Reg 如上Table 141
	// 2 : BAR Virtualization ACL Reg
	// 3 : CXL Memory Device Registers
	// Ref CXL 2.0 Spec 8.1.9 Register Locator DVSEC
	//                  8.1.9.1 Register Offset Low
	rc = cxl_find_regblock(pdev, type, map);
	if (rc)
		return rc;
	// 根据上面的信息,找到对应的 BAR 进行 io 映射并保存寄存器块的基地址,详情在下个函数
	rc = cxl_map_regblock(pdev, map);
	if (rc)
		return rc;

	rc = cxl_probe_regs(pdev, map);
	cxl_unmap_regblock(pdev, map);

	return rc;
}

static int cxl_map_regblock(struct pci_dev *pdev, struct cxl_register_map *map)
{
	void __iomem *addr;
	int bar = map->barno;
	struct device *dev = &pdev->dev;
	resource_size_t offset = map->block_offset;

	/* Basic sanity check that BAR is big enough */
	// 检查 BAR 总大小是否小于偏移,如果是报错
	// 寄存器所在的偏移应该是在 BAR 空间内
	if (pci_resource_len(pdev, bar) < offset) {
		dev_err(dev, "BAR%d: %pr: too small (offset: %pa)\n", bar,
			&pdev->resource[bar], &offset);
		return -ENXIO;
	}
	// 映射 BAR 空间,bar 是序号,0表示不检查长度,全部映射
	addr = pci_iomap(pdev, bar, 0);
	if (!addr) {
		dev_err(dev, "failed to map registers\n");
		return -ENOMEM;
	}

	dev_dbg(dev, "Mapped CXL Memory Device resource bar %u @ %pa\n",
		bar, &offset);

	// 获取寄存器虚拟地址空间的基地址,内核可直接读写访问
	map->base = addr + map->block_offset;
	return 0;
}


static int cxl_probe_regs(struct pci_dev *pdev, struct cxl_register_map *map)
{
	struct cxl_component_reg_map *comp_map;
	struct cxl_device_reg_map *dev_map;
	struct device *dev = &pdev->dev;
	void __iomem *base = map->base;

	// 根据不同的寄存器类型,做不同的处理
	switch (map->reg_type) {
	case CXL_REGLOC_RBI_COMPONENT:
		// 如果是组件寄存器
		comp_map = &map->component_map;
		// 参考另一篇文章 Regs.c
		// 记录 HDM Decoder 寄存器块的offset 以及长度
		cxl_probe_component_regs(dev, base, comp_map);
		if (!comp_map->hdm_decoder.valid) {
			dev_err(dev, "HDM decoder registers not found\n");
			return -ENXIO;
		}

		dev_dbg(dev, "Set up component registers\n");
		break;
	case CXL_REGLOC_RBI_MEMDEV:
		// 如果是 CXL 内存设备寄存器
		dev_map = &map->device_map;
		// 参考另一篇文章 Regs.c
		// 记录 CXL Device 寄存器块的offset 以及长度
		cxl_probe_device_regs(dev, base, dev_map);
		if (!dev_map->status.valid || !dev_map->mbox.valid ||
		    !dev_map->memdev.valid) {
			dev_err(dev, "registers not found: %s%s%s\n",
				!dev_map->status.valid ? "status " : "",
				!dev_map->mbox.valid ? "mbox " : "",
				!dev_map->memdev.valid ? "memdev " : "");
			return -ENXIO;
		}

		dev_dbg(dev, "Probing device registers...\n");
		break;
	default:
		break;
	}

	return 0;
}

static void devm_cxl_pci_create_doe(struct cxl_dev_state *cxlds)
{
	struct device *dev = cxlds->dev;
	struct pci_dev *pdev = to_pci_dev(dev);
	u16 off = 0;

	// Initialise an empty XArray.
	xa_init(&cxlds->doe_mbs);
	// 管理资源接口,linux kernel 相关接口,非重点
	if (devm_add_action(&pdev->dev, cxl_pci_destroy_doe, &cxlds->doe_mbs)) {
		dev_err(dev, "Failed to create XArray for DOE's\n");
		return;
	}

	/*
	 * Mailbox creation is best effort.  Higher layers must determine if
	 * the lack of a mailbox for their protocol is a device failure or not.
	 */
	// 遍历枚举每一个 DOE Capability
	pci_doe_for_each_off(pdev, off) {
		struct pci_doe_mb *doe_mb;
		// Create a DOE mailbox object
		// 详情见另一篇 doe.c
		doe_mb = pcim_doe_create_mb(pdev, off);
		if (IS_ERR(doe_mb)) {
			dev_err(dev, "Failed to create MB object for MB @ %x\n",
				off);
			continue;
		}
		// Store this entry in the XArray unless another entry is already present.
		// 存储到数组中
		if (xa_insert(&cxlds->doe_mbs, off, doe_mb, GFP_KERNEL)) {
			dev_err(dev, "xa_insert failed to insert MB @ %x\n",
				off);
			continue;
		}

		dev_dbg(dev, "Created DOE mailbox @%x\n", off);
	}
}

3. Mailbox Registers

请添加图片描述

4. Mailbox Capabilities Register

请添加图片描述

5. Mailbox Control Register

请添加图片描述

6. Mailbox Interfaces Ready

请添加图片描述

. Spec 引用,mailbox 命令超时时间

The mailbox command timeout is 2 seconds. Commands that require a longer execution time shall be completed asynchronously in the background. Only one command can be executed in the background at a time.

// Ref CXL 2.0 8.2.8.4.4 Mailbox Control Register (Mailbox Registers Capability Offset + 04h)
// bit0 DoorBell : 当为 0 时表示设备准备接收新的命令;调用者会置1,告诉设备命令已经准备好输入了
// 当置1时只读, 当命令完成后由设备清0, 如上图 5. Mailbox Control Register
// 所以为 1 时表示设备 mailbox 在忙
#define cxl_doorbell_busy(cxlds)                                                \
	(readl((cxlds)->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET) &                  \
	 CXLDEV_MBOX_CTRL_DOORBELL)

static int cxl_pci_mbox_wait_for_doorbell(struct cxl_dev_state *cxlds)
{
	const unsigned long start = jiffies;
	unsigned long end = start;
	// polling 查询mailbox 寄存器的状态
	while (cxl_doorbell_busy(cxlds)) {
		end = jiffies;

		if (time_after(end, start + CXL_MAILBOX_TIMEOUT_MS)) {
			// mailbox command 超时时间 2 S, 协议规定, 如上 6. 引用部分
			// Ref CXL 2.0 8.2.8.4 Mailbox Registers (Offset Varies)
			/* Check again in case preempted before timeout test */
			if (!cxl_doorbell_busy(cxlds))
				break;
			return -ETIMEDOUT;
		}
		cpu_relax();
	}

	dev_dbg(cxlds->dev, "Doorbell wait took %dms",
		jiffies_to_msecs(end) - jiffies_to_msecs(start));
	return 0;
}

static int cxl_pci_setup_mailbox(struct cxl_dev_state *cxlds)
{
	const int cap = readl(cxlds->regs.mbox + CXLDEV_MBOX_CAPS_OFFSET);
	unsigned long timeout;
	u64 md_status;

	timeout = jiffies + mbox_ready_timeout * HZ;
	// 首先查询设备是否准备好mailbox
	do {
		// Ref CXL 2.0 Spec 8.2.8.5.1.1 Memory Device Status Register
		// or 上图 6. Mailbox Interfaces Ready
		// bit4 置1表示设备已经准备好通过 mailbox 接收命令了
		// CXLMDEV_MBOX_IF_READY == 0x4
		md_status = readq(cxlds->regs.memdev + CXLMDEV_STATUS_OFFSET);
		if (md_status & CXLMDEV_MBOX_IF_READY)
			break;
		if (msleep_interruptible(100))
			break;
	} while (!time_after(jiffies, timeout));

	if (!(md_status & CXLMDEV_MBOX_IF_READY)) {
		cxl_err(cxlds->dev, md_status,
			"timeout awaiting mailbox ready");
		return -ETIMEDOUT;
	}

	/*
	 * A command may be in flight from a previous driver instance,
	 * think kexec, do one doorbell wait so that
	 * __cxl_pci_mbox_send_cmd() can assume that it is the only
	 * source for future doorbell busy events.
	 */
	// 前面详细介绍了
	// 等待 mailbox 空闲
	if (cxl_pci_mbox_wait_for_doorbell(cxlds) != 0) {
		cxl_err(cxlds->dev, md_status, "timeout awaiting mailbox idle");
		return -ETIMEDOUT;
	}

	cxlds->mbox_send = cxl_pci_mbox_send;
	// Payload Size: Size of the Command Payload Registers in bytes, expressed as 2^n.
	// The minimum size is 256 bytes (n=8) and the maximum size is 1 MB (n=20).
	// Ref CXL 2.0 8.2.8.4.3 Mailbox Capabilities Register
	cxlds->payload_size =
		1 << FIELD_GET(CXLDEV_MBOX_CAP_PAYLOAD_SIZE_MASK, cap);

	/*
	 * CXL 2.0 8.2.8.4.3 Mailbox Capabilities Register
	 *
	 * If the size is too small, mandatory commands will not work and so
	 * there's no point in going forward. If the size is too large, there's
	 * no harm is soft limiting it.
	 */
	cxlds->payload_size = min_t(size_t, cxlds->payload_size, SZ_1M);
	if (cxlds->payload_size < 256) {
		dev_err(cxlds->dev, "Mailbox is too small (%zub)",
			cxlds->payload_size);
		return -ENXIO;
	}

	dev_dbg(cxlds->dev, "Mailbox payload sized %zu",
		cxlds->payload_size);

	return 0;
}

最后剩下一个重要的 mbox send 接口,其实理解也很简单,就是根据一系列寄存器,进行数据读写。


static int cxl_pci_mbox_send(struct cxl_dev_state *cxlds, struct cxl_mbox_cmd *cmd)
{
	int rc;

	mutex_lock_io(&cxlds->mbox_mutex);
	rc = __cxl_pci_mbox_send_cmd(cxlds, cmd);
	mutex_unlock(&cxlds->mbox_mutex);

	return rc;
}

主要函数为 __cxl_pci_mbox_send_cmd,执行一个 mailbox 命令:

CXL 2.0 8.2.8.4 Mailbox Registers

The flow for executing a command is described below. The term “caller” represents the entity submitting the command:

  1. Caller reads MB Control Register to verify doorbell is clear
  2. Caller writes Command Register
  3. Caller writes Command Payload Registers if input payload is non-empty
  4. Caller writes MB Control Register to set doorbell
  5. Caller either polls for doorbell to be clear or waits for interrupt if configured
  6. Caller reads MB Status Register to fetch Return code
  7. If command successful, Caller reads Command Register to get Payload Length
  8. If output payload is non-empty, host reads Command Payload Registers

/**
 * __cxl_pci_mbox_send_cmd() - Execute a mailbox command
 * @cxlds: The device state to communicate with.
 * @mbox_cmd: Command to send to the memory device.
 *
 * Context: Any context. Expects mbox_mutex to be held.
 * Return: -ETIMEDOUT if timeout occurred waiting for completion. 0 on success.
 *         Caller should check the return code in @mbox_cmd to make sure it
 *         succeeded.
 *
 * This is a generic form of the CXL mailbox send command thus only using the
 * registers defined by the mailbox capability ID - CXL 2.0 8.2.8.4. Memory
 * devices, and perhaps other types of CXL devices may have further information
 * available upon error conditions. Driver facilities wishing to send mailbox
 * commands should use the wrapper command.
 *
 * The CXL spec allows for up to two mailboxes. The intention is for the primary
 * mailbox to be OS controlled and the secondary mailbox to be used by system
 * firmware. This allows the OS and firmware to communicate with the device and
 * not need to coordinate with each other. The driver only uses the primary
 * mailbox.
 */
static int __cxl_pci_mbox_send_cmd(struct cxl_dev_state *cxlds,
				   struct cxl_mbox_cmd *mbox_cmd)
{
	void __iomem *payload = cxlds->regs.mbox + CXLDEV_MBOX_PAYLOAD_OFFSET;
	struct device *dev = cxlds->dev;
	u64 cmd_reg, status_reg;
	size_t out_len;
	int rc;

	lockdep_assert_held(&cxlds->mbox_mutex);

	/*
	 * Here are the steps from 8.2.8.4 of the CXL 2.0 spec.
	 *   1. Caller reads MB Control Register to verify doorbell is clear
	 *   2. Caller writes Command Register
	 *   3. Caller writes Command Payload Registers if input payload is non-empty
	 *   4. Caller writes MB Control Register to set doorbell
	 *   5. Caller either polls for doorbell to be clear or waits for interrupt if configured
	 *   6. Caller reads MB Status Register to fetch Return code
	 *   7. If command successful, Caller reads Command Register to get Payload Length
	 *   8. If output payload is non-empty, host reads Command Payload Registers
	 *
	 * Hardware is free to do whatever it wants before the doorbell is rung,
	 * and isn't allowed to change anything after it clears the doorbell. As
	 * such, steps 2 and 3 can happen in any order, and steps 6, 7, 8 can
	 * also happen in any order (though some orders might not make sense).
	 */
	// 基本时按照规范,依次进行
	/* #1 Caller reads MB Control Register to verify doorbell is clear */
	// 第一步,确保 mailbox 空闲,通过查看 doorbell 状态位
	if (cxl_doorbell_busy(cxlds)) {
		u64 md_status =
			readq(cxlds->regs.memdev + CXLMDEV_STATUS_OFFSET);

		cxl_cmd_err(cxlds->dev, mbox_cmd, md_status,
			    "mailbox queue busy");
		return -EBUSY;
	}

	cmd_reg = FIELD_PREP(CXLDEV_MBOX_CMD_COMMAND_OPCODE_MASK,
			     mbox_cmd->opcode);
	if (mbox_cmd->size_in) {
		if (WARN_ON(!mbox_cmd->payload_in))
			return -EINVAL;
	// 3. Caller writes Command Payload Registers if input payload is non-empty
		cmd_reg |= FIELD_PREP(CXLDEV_MBOX_CMD_PAYLOAD_LENGTH_MASK,
				      mbox_cmd->size_in);
		memcpy_toio(payload, mbox_cmd->payload_in, mbox_cmd->size_in);
	}

	/* #2, #3 */
	// 2. Caller writes Command Register
	writeq(cmd_reg, cxlds->regs.mbox + CXLDEV_MBOX_CMD_OFFSET);

	/* #4 */
	// 4. Caller writes MB Control Register to set doorbell
	// 调用者写控制寄存器,设置 doorbell 为 1,表示设备在忙
	dev_dbg(dev, "Sending command\n");
	writel(CXLDEV_MBOX_CTRL_DOORBELL,
	       cxlds->regs.mbox + CXLDEV_MBOX_CTRL_OFFSET);

	/* #5 */
	// 5. Caller either polls for doorbell to be clear or waits for interrupt if configured
	// 等待结束可以使用轮询或者中断方式
	rc = cxl_pci_mbox_wait_for_doorbell(cxlds);
	if (rc == -ETIMEDOUT) {
		u64 md_status = readq(cxlds->regs.memdev + CXLMDEV_STATUS_OFFSET);

		cxl_cmd_err(cxlds->dev, mbox_cmd, md_status, "mailbox timeout");
		return rc;
	}

	/* #6 */
	// 6. Caller reads MB Status Register to fetch Return code
	// 调用者读状态寄存器,获取返回码
	status_reg = readq(cxlds->regs.mbox + CXLDEV_MBOX_STATUS_OFFSET);
	mbox_cmd->return_code =
		FIELD_GET(CXLDEV_MBOX_STATUS_RET_CODE_MASK, status_reg);

	if (mbox_cmd->return_code != CXL_MBOX_CMD_RC_SUCCESS) {
		dev_dbg(dev, "Mailbox operation had an error: %s\n",
			cxl_mbox_cmd_rc2str(mbox_cmd));
		return 0; /* completed but caller must check return_code */
	}

	/* #7 */
	// 7. If command successful, Caller reads Command Register to get Payload Length
	// 如果返回成功,调用者读命令寄存器获取数据长度
	cmd_reg = readq(cxlds->regs.mbox + CXLDEV_MBOX_CMD_OFFSET);
	out_len = FIELD_GET(CXLDEV_MBOX_CMD_PAYLOAD_LENGTH_MASK, cmd_reg);

	/* #8 */
	// 8. If output payload is non-empty, host reads Command Payload Registers
	// 如果长度不为空,则读取数据
	if (out_len && mbox_cmd->payload_out) {
		/*
		 * Sanitize the copy. If hardware misbehaves, out_len per the
		 * spec can actually be greater than the max allowed size (21
		 * bits available but spec defined 1M max). The caller also may
		 * have requested less data than the hardware supplied even
		 * within spec.
		 */
		size_t n = min3(mbox_cmd->size_out, cxlds->payload_size, out_len);

		memcpy_fromio(mbox_cmd->payload_out, payload, n);
		mbox_cmd->size_out = n;
	} else {
		mbox_cmd->size_out = 0;
	}

	return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/88675.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

java计算机毕业设计ssm智能线上教育mo0l5(附源码、数据库)

java计算机毕业设计ssm智能线上教育mo0l5&#xff08;附源码、数据库&#xff09; 项目运行 环境配置&#xff1a; Jdk1.8 Tomcat8.5 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。…

性能测试知识之三大模型

今天的这篇文章我会聊聊在实际工作中开展性能测试&#xff0c;前期最核心的工作。即业务模型、流量模型和数据模型这三大模型&#xff0c;该如何评估和建立。在性能测试工作中&#xff0c;业务模型、流量模型和数据模型是至关重要且必须在项目中构建的&#xff0c;否则很可能导…

【算法分析与设计】【期中(末)复习题】【2022秋】

文章目录一. 单选题二. 填空题三. 判断题四. 多选题一. 单选题 1.按照渐近阶从低到高的顺序排列下列表达式&#xff1a; 30n&#xff0c;2logn&#xff0c;4&#xff0c;n! A. 4<30n<2logn<n! B. 30n<4<2logn<n! C. n!<4<2logn<30n D. 4<2logn&…

YOLO算法改进之结合GradCAM可视化热力图(附详细教程)

🎄🎄YOLOv5/v7改进之结合GradCAM可视化热力图(附详细教程)🎄🎄 🚀🚀🚀NEW!!!魔改YOLOv5/v7目标检测算法来啦 ~ 🐱‍🏍 计算机视觉 —— 致力于目标检测领域科研Tricks改进与推荐 | 主要包括主干网络改进、轻量化网络、注意力机制、检测头部改进、空间金…

主数据管理(MDM),数据中台,国内有哪些知名供应商呢?

当企业的信息化、数据化发展到一定阶段的时候&#xff0c;大部分企业都会对主数据管理产生需求。为帮助企业加速数字化建设步伐&#xff0c;亿信华辰凭借多年在行业领域内积累的丰富经验并结合相关大数据技术成功打造了一款主数据管理产品&#xff0c;覆盖主数据标准、主数据质…

019 | 探究布衣上的刺绣图腾文化功能——以贵州册亨县布依族刺绣为例 | 大学生创新训练项目申请书 | 极致技术工厂

研究目的 当今我国社会的主要矛盾是人民日益增长的美好生活需要和不平衡不充分的发展之间的矛盾。但经济增长过快所带来的联动效应&#xff0c;导致人们一定程度上只注重金钱、利益&#xff0c;从而忽视了培养高尚的理想信念和增强民族精神的重要性。社会要保持平衡性&#xff…

基于低代码平台设计的订单管理系统,助力家具行业信息化建设

编者按&#xff1a;随着信息化的高速发展&#xff0c;传统的人工订单管理模式已经不适合现在企业发展的需求&#xff0c;一个成熟的订单管理系统可以帮助企业解决订单管理混乱的问题。本文介绍了低代码平台在订单管理系统实现方面的优势&#xff0c;并展示了相关案例。 关键词…

PE文件详解

字节存放顺序是小尾存储&#xff0c;高位保存高字节、低位保存低字节&#xff0c;因此是两位两位倒着读 1、DOS头&#xff1a;包括MZ头和DOS存根&#xff0c;指向DOS可执行程序部分 &#xff08;1&#xff09;MZ头&#xff1a;长度 40H&#xff0c;即4行乘16位&#xff0c; e_…

mmap

文章目录使用示例函数原型mmapmunmap传统读写文件mmap 原理eager实现lazy实现缺点使用示例 #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <sys/mman.h>int main(i…

高并发编程之阻塞队列

9 阻塞队列 9.1 BlockingQueue 简介 Concurrent 包中&#xff0c;BlockingQueue 很好的解决了多线程中&#xff0c;如何高效安全 “传输”数据的问题。通过这些高效并且线程安全的队列类&#xff0c;为我们快速搭建 高质量的多线程程序带来极大的便利。本文详细介绍了 Bloc…

十四、JavaScript——类型转化_数值

一、定义 将其他的数据类型转化为数值 使用Number()函数来将其他类型转化为数值&#xff0c;适用于任何类型使用parseInt() -- 将一个字符串转化为一个整数 -解析时&#xff0c;会自作向右读取一个字符串&#xff0c;直到读取到所有的整数位 parseFloat()…

想学设计模式、想搞架构设计,先学学 UML 系统建模吧

UML 系统建模 1 概述 1.1 课程概述 汇集 UML 及其相关的一些话题回顾 UML 相关的符号与概念以电商订单相关业务为例&#xff0c;借助 UML 完成系统建模将 UML 变成提升建模效率&#xff0c;表达架构思想的工具 1.2 什么是 UML ​ Unified Modeling Language 统一建模语言&a…

MEMS运动传感器:三轴数字输出陀螺仪——L3GD20

一、框图和引脚说明 二、机械和电气规格 三、应用 四、数字框图 4.1 框图 4.2 FIFO L3GD20为三个输出通道(偏航、俯仰和滚转)分别嵌入了32个16位数据FIFO槽。 五种模式&#xff1a;Bypass mode、FIFO mode、Stream mode、Bypass-to-Stream mode and Stream-to-FIFO mode。 …

ICG-Amine|ICG标记氨基|ICG-NH2

ICG-Amine|ICG标记氨基|ICG-NH2 中文名称&#xff1a;ICG标记氨基英文名称&#xff1a;ICG-Amine 分子式&#xff1a;C47H56N4O4S 分子量&#xff1a;773.04 外观&#xff1a;绿色粉末 溶解度&#xff1a;二氯甲烷 纯度&#xff1a;95% 结构式&#xff1a; Indocyanine …

JUC并发编程第十二篇,详解Synchronized与锁升级

详解Synchronized与锁升级一、概述二、Synchronized 版本升级优化与锁对象1、版本变化2、为什么每一个对象都可以成为一个锁&#xff1f;三、Synchronized锁升级步骤详解1、如何升级&#xff1f;2、无锁&#xff0c;不会出现竞争3、偏向锁4、轻量级锁5、重锁6、三种锁的比较四、…

接口测试实战 | Android 高版本无法抓取 HTTPS,怎么办?

image1080327 43.8 KB 【编者按】本文为霍格沃兹测试学院 yuye 同学的接口测试实践笔记。 在接口测试中&#xff0c;相信很多人都遇到过 Android 高版本&#xff08;Android7.0 以上&#xff09;系统无法抓包的问题。 由于在测试过程中对分析定位问题很不方便&#xff0c;所以…

Solidity地址支付方法Send、Transfer和Call的使用

以上三种转账方式都属于地址的成员属性&#xff08;members of address&#xff09;。 参见地址成员类型 Transfer 如果当前合约的余额不够大或者 Ether转账被接收账户拒绝&#xff0c;转账功能将失败。接收方智能合约应定义回退函数&#xff0c;否则转账调用将引发错误。tr…

以生态共建促产业发展,点亮HPC新未来

作者 | 曾响铃 文 | 响铃说 作为IT行业的“明珠”&#xff0c;极“硬核”的高性能计算不如云计算、AI、物联网技术备受关注。但不可忽视的是&#xff0c;近年来&#xff0c;高性能计算正在从高精尖科研加速迈向千行百业&#xff0c;成为推动数字经济发展的新引擎。在近日举办…

springboot - 原理初探

自动配置&#xff1a; 1、pom.xml &#xff08;1&#xff09;sping-boot-dependencies&#xff1a;核心依赖在父工程中&#xff01;&#xff01;&#xff01; &#xff08;pom.xml文件中&#xff0c;spring-boot-starter-parent 点进去&#xff0c;然后&#xff0c;spring-…

C51 - 准双向I/O口结构

Contents1> P1口1.1> 写 "0" 过程1.2> 写 "1" 过程1.3> 读引脚”准“双向问题&#xff1a;1.4> 读 寄存器2> P3口3> P0口1> P1口 没画【P1.0/T2】【P1.1/T2EX】第2功能&#xff1b; 1.1> 写 “0” 过程 D触发器FF1&#xff0c;…