/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2023 Red Hat */ #ifndef VDO_PACKER_H #define VDO_PACKER_H #include #include "admin-state.h" #include "constants.h" #include "encodings.h" #include "statistics.h" #include "types.h" #include "wait-queue.h" enum { DEFAULT_PACKER_BINS = 16, }; /* The header of a compressed block. */ struct compressed_block_header { /* Unsigned 32-bit major and minor versions, little-endian */ struct packed_version_number version; /* List of unsigned 16-bit compressed block sizes, little-endian */ __le16 sizes[VDO_MAX_COMPRESSION_SLOTS]; } __packed; enum { VDO_COMPRESSED_BLOCK_DATA_SIZE = VDO_BLOCK_SIZE - sizeof(struct compressed_block_header), /* * A compressed block is only written if we can pack at least two fragments into it, so a * fragment which fills the entire data portion of a compressed block is too big. */ VDO_MAX_COMPRESSED_FRAGMENT_SIZE = VDO_COMPRESSED_BLOCK_DATA_SIZE - 1, }; /* * The compressed block overlay. */ struct compressed_block { struct compressed_block_header header; char data[VDO_COMPRESSED_BLOCK_DATA_SIZE]; } __packed; /* * Each packer_bin holds an incomplete batch of data_vios that only partially fill a compressed * block. The bins are kept in a list sorted by the amount of unused space so the first bin with * enough space to hold a newly-compressed data_vio can easily be found. When the bin fills up or * is flushed, the first uncanceled data_vio in the bin is selected to be the agent for that bin. * Upon entering the packer, each data_vio already has its compressed data in the first slot of the * data_vio's compressed_block (overlaid on the data_vio's scratch_block). So the agent's fragment * is already in place. The fragments for the other uncanceled data_vios in the bin are packed into * the agent's compressed block. The agent then writes out the compressed block. If the write is * successful, the agent shares its pbn lock which each of the other data_vios in its compressed * block and sends each on its way. Finally the agent itself continues on the write path as before. * * There is one special bin which is used to hold data_vios which have been canceled and removed * from their bin by the packer. These data_vios need to wait for the canceller to rendezvous with * them and so they sit in this special bin. */ struct packer_bin { /* List links for packer.packer_bins */ struct list_head list; /* The number of items in the bin */ slot_number_t slots_used; /* The number of compressed block bytes remaining in the current batch */ size_t free_space; /* The current partial batch of data_vios, waiting for more */ struct data_vio *incoming[]; }; struct packer { /* The ID of the packer's callback thread */ thread_id_t thread_id; /* The number of bins */ block_count_t size; /* A list of all packer_bins, kept sorted by free_space */ struct list_head bins; /* * A bin to hold data_vios which were canceled out of the packer and are waiting to * rendezvous with the canceling data_vio. */ struct packer_bin *canceled_bin; /* The current flush generation */ sequence_number_t flush_generation; /* The administrative state of the packer */ struct admin_state state; /* Statistics are only updated on the packer thread, but are accessed from other threads */ struct packer_statistics statistics; }; int vdo_get_compressed_block_fragment(enum block_mapping_state mapping_state, struct compressed_block *block, u16 *fragment_offset, u16 *fragment_size); int __must_check vdo_make_packer(struct vdo *vdo, block_count_t bin_count, struct packer **packer_ptr); void vdo_free_packer(struct packer *packer); struct packer_statistics __must_check vdo_get_packer_statistics(const struct packer *packer); void vdo_attempt_packing(struct data_vio *data_vio); void vdo_flush_packer(struct packer *packer); void vdo_remove_lock_holder_from_packer(struct vdo_completion *completion); void vdo_increment_packer_flush_generation(struct packer *packer); void vdo_drain_packer(struct packer *packer, struct vdo_completion *completion); void vdo_resume_packer(struct packer *packer, struct vdo_completion *parent); void vdo_dump_packer(const struct packer *packer); #endif /* VDO_PACKER_H */ lue='linux-4.20.y'>linux-4.20.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/nvidia/tegra132.dtsi
AgeCommit message (Expand)Author
2023-01-17arm64: tegra: Sort nodes by unit-address, then alphabeticallyThierry Reding
2022-11-21arm64: tegra: Remove unneeded clock-names for Tegra132 PWMThierry Reding
2021-12-16arm64: tegra: Rename thermal zones nodesThierry Reding
2021-12-16arm64: tegra: Sort Tegra132 XUSB clocks correctlyThierry Reding
2021-12-16arm64: tegra: Drop unused AHCI clocks on Tegra132Thierry Reding
2021-12-16arm64: tegra: Fix Tegra132 I2C compatible string listThierry Reding
2021-12-16arm64: tegra: Add OPP tables on Tegra132Thierry Reding
2021-12-16arm64: tegra: Fix compatible string for Tegra132 timerThierry Reding
2021-10-07arm64: tegra: Remove useless usb-ehci compatible stringThierry Reding
2021-10-04arm64: tegra: Add new USB PHY properties on Tegra132Dmitry Osipenko
2021-08-13arm64: tegra: Fix compatible string for Tegra132 CPUsThierry Reding
2020-11-26arm64: tegra: Change order of SATA resets for Tegra132 and Tegra210Sowjanya Komatineni
2020-11-25arm64: tegra: Hook up edp interrupt on Tegra132 SOCTHERMThierry Reding
2020-11-25arm64: tegra: Add missing hot temperatures to Tegra132 thermal-zonesNicolas Chauvet
2020-07-15arm64: tegra: Add i2c-bus subnode for DPAUX controllersThierry Reding
2020-07-15arm64: tegra: Fix indentation in Tegra132 device treeThierry Reding
2020-07-15arm64: tegra: Add missing #phy-cells property to USB PHYsThierry Reding
2020-07-15arm64: tegra: Tegra132 EMC is not compatible with Tegra124Thierry Reding
2020-07-15arm64: tegra: Use sor0_out clock on Tegra132Thierry Reding
2020-07-15arm64: tegra: Do not mark host1x as simple busThierry Reding
2020-07-15arm64: tegra: Use proper tuple notationThierry Reding
2020-07-13arm64: tegra: Enable XUSB on NorrinThierry Reding
2020-06-23arm64: tegra: Rename sdhci nodes to mmcThierry Reding
2020-06-23arm64: tegra: Remove parent clock from display controllersThierry Reding
2020-06-23arm64: tegra: Add interrupt-names for host1xThierry Reding
2020-06-23arm64: tegra: Add Tegra132 compatible string for host1xThierry Reding
2020-03-12arm64: tegra: Add clock-cells property to Tegra PMC nodeSowjanya Komatineni
2020-01-09arm64: tegra: Rename EMC on Tegra132Thierry Reding
2020-01-09arm64: tegra: Let the EMC hardware use the EMC clockThierry Reding
2019-01-30arm64: dts: Remove inconsistent use of 'arm,armv8' compatible stringRob Herring
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman
2017-06-13arm64: dts: nvidia: fix PCI bus dtc warningsRob Herring
2017-04-04arm64: tegra: Update the Tegra132 flowctrl compatible stringJon Hunter
2016-09-27arm64: tegra: set hot trips for Tegra132Wei Ni
2016-09-27arm64: tegra: set critical trips for Tegra132Wei Ni
2016-09-27arm64: tegra: use tegra132-soctherm for Tegra132Wei Ni
2016-04-11arm64: tegra: Fix copy/paste typo in several DTS includesThierry Reding
2016-04-11arm64: tegra: Remove 0, prefix from unit-addressesThierry Reding
2016-03-04arm64: Fix misspellings in comments.Adam Buchbinder
2015-11-24arm64: tegra: Add Tegra132 supportThierry Reding