CN115033501A - System, method, equipment and medium for invalidation cache data - Google Patents

System, method, equipment and medium for invalidation cache data Download PDF

Info

Publication number
CN115033501A
CN115033501A CN202210756398.6A CN202210756398A CN115033501A CN 115033501 A CN115033501 A CN 115033501A CN 202210756398 A CN202210756398 A CN 202210756398A CN 115033501 A CN115033501 A CN 115033501A
Authority
CN
China
Prior art keywords
task
array
failure
volume
cache data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210756398.6A
Other languages
Chinese (zh)
Inventor
邵雨恬
赵书龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210756398.6A priority Critical patent/CN115033501A/en
Publication of CN115033501A publication Critical patent/CN115033501A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a system, a method, equipment and a medium for invalidation cache data, wherein the system comprises: the system comprises a failure task management module and a failure task execution module; the failure task management module is configured to add the volume which initiates the failure request into a task request array, and schedule a failure subtask to execute the failure request; the disabled task execution module is configured to: adding all volumes in the task request array into the task execution array and setting a null task request array; traversing the linked list to obtain cache data, and judging whether the cache data fails or not; in response to the traversal step length reaching the threshold, ending the failure subtask, recording a traversal position, and comparing the traversal position with the linked list tail to determine whether to remove the first volume from the task in an array manner; and judging whether the task request array and the task processing array are empty or not to determine whether the invalidation task of the cache data is finished or not. By the scheme of the invention, the batch invalidation processing of the cache data in the cache partition is realized, and the invalidation processing efficiency is improved.

Description

System, method, equipment and medium for invalidation cache data
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a system, a method, a device, and a medium for cache invalidation.
Background
In the field of storage, batch-failed multi-volume cache data is a common demand scenario, such as deleting a volume, rejoining a cluster after a node in a multi-node storage device exits, and the like. In the existing general implementation manner, generally, invalidation tasks of each volume are parallel to a bound CPU, and a linked list of cache data blocks is maintained in a cache partition in each task to invalidate respective data.
Meanwhile, the total flow of the failure task is often long, and in order to ensure normal operation of other services, the failure task of the whole volume at a time is often required to be split into a plurality of subtasks. However, due to the different lock performance and the congestion degree of a plurality of CPUs for processing the failed tasks, the processing mechanism may cause a part of the subtasks scheduled first to wait for timeout on a busy CPU, thereby causing service interruption. Today, the requirement of the service end on the performance and availability of the storage device is continuously upgraded, and a solution for processing the invalid cache data in batch is needed to solve the above problems.
Disclosure of Invention
In view of the above, the present invention provides a system, a method, a device, and a medium for invalidating cache data, which ensure efficient and reliable completion of batch invalidating cache data tasks through an invalidating task management module and an invalidating task execution module, so that the invalidating task of multi-volume cache data is no longer directly dependent on the original multi-thread task processing mechanism, and therefore, the problems of service interruption and the like caused by timeout waiting do not occur.
Based on the foregoing object, an aspect of the embodiments of the present invention provides a system for invalidating cached data, where the system specifically includes:
the system comprises a failure task management module and a failure task execution module;
the failure task management module is configured to receive a failure request initiated by a volume, add the volume initiating the failure request into a task request array under write lock protection, and schedule a failure subtask for executing the failure request;
the failure task execution module is configured to add all volumes in the task request array into a task execution array and empty the task request array when the failure subtask is performed;
the invalidation task execution module is also configured to traverse a linked list maintaining cache data in a cache partition to obtain the cache data based on the linked list, and determine whether to invalidate the cache data based on whether the cache data belongs to a volume in the task processing array;
the failure task execution module is further configured to respond to the traversal step size reaching a threshold value, end the failure subtask, and record a traversal position to a first volume in the task processing array;
the failure task execution module is further configured to compare the traversal position with a linked list tail of the linked list to determine whether to remove the first volume from the task in the array and whether to notify the failure task management module to call a new subtask to continue executing volumes in the task in the array;
the invalidation task execution module is also configured to judge whether the task request array and the task progress array are empty, and determine whether the invalidation task of the cache data is finished based on the judgment result.
In some embodiments, traversing a linked list maintaining cache data in a cache partition to obtain cache data based on the linked list comprises:
and traversing the linked list for maintaining the cache data in the cache partition, and acquiring the cache data with a failure flag bit of FALSE based on the linked list.
In some embodiments, determining whether to invalidate the cached data based on whether the cached data belongs to a volume in the task progress array comprises:
judging whether the cache data with the failure flag bit being FALSE belongs to the volume in the task processing array;
and in response to that the cache data with the failure flag bit of FALSE belongs to the volume in the task processing array, setting the failure flag bit of the cache data to TRUE.
In some embodiments, comparing the traversal location to the linked-list tail of the linked-list to determine whether to remove the first volume from the task in array and to notify the failed task management module to invoke a new subtask to continue executing a volume in the task in array includes:
responding to the end of the execution of the failure subtask, and judging whether the traversal position is greater than or equal to the linked list tail of the linked list;
in response to the traversing position being larger than or equal to the tail of the chain table, ending the failure subtask of the first volume, and performing array removal on the first volume from the task;
and responding to the traversal position not larger than the tail of the chain table, and sending a message to the failure task management module to inform the failure task management module to schedule a new subtask to continue to execute the volume in the task processing array.
In some embodiments, determining whether the task request array and the task progress array are empty, and determining whether the invalidation task of the cache data is finished based on the determination result includes:
judging whether the task request array and the task processing array are empty or not;
responding to the task request array and the task processing array to be empty, and ending the invalidation task of the cache data;
and in response to the fact that the task request array is not empty and the task progress array is not empty or the task request array is not empty and the task progress array is empty or the task request array is empty and the task progress array is not empty, notifying the failure task management module to schedule a new subtask to continue executing the volume in the task progress array.
In some embodiments, the failed task management module is further configured to flag the status of the failed task management module based on the scheduling and execution of the failed subtasks.
In some embodiments, the states of the dead task management module include an idle state, a scheduled state, an executing state, and a waiting for scheduled state.
In another aspect of the embodiments of the present invention, a method for invalidating cache data is further provided, where the method includes:
receiving a failure request initiated by a volume based on a failure task management module, adding the volume initiating the failure request into a task request array under write lock protection, and scheduling a failure subtask to execute the failure request;
when the failure subtask is carried out, adding all volumes in the task request array into a task execution array based on a failure task execution module, and emptying the task request array;
traversing a linked list maintaining cache data in a cache partition based on the invalidation task execution module to obtain the cache data based on the linked list, and judging whether the cache data is invalidated based on whether the cache data belongs to a volume in the task processing array;
in response to the traversing step reaching a threshold value, finishing the failure subtask based on the failure task execution module, and recording a traversing position to a first volume in the task processing array;
comparing the traversal position with the linked list tail of the linked list based on the failed task execution module to determine whether to remove the first volume from the task progress array and whether to inform the failed task management module to call a new subtask to continue executing the volume in the task progress array;
and judging whether the task request array and the task processing array are empty or not based on the invalidation task execution module, and determining whether the invalidation task of the cache data is finished or not based on a judgment result.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing a computer program executable on the processor, the computer program implementing the steps of the method as above when executed by the processor.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has at least the following beneficial technical effects: the invalidation task management module schedules corresponding subtasks of the cache data invalidation requests (namely invalidation tasks) of one or more volumes of the unified cache partition according to traversal step length and delivers the corresponding subtasks to the invalidation task execution module for execution, so that batch invalidation processing of the cache data is realized, the batch invalidation processing of the cache data can be efficiently and reliably completed, the multivolume cache data invalidation task is not directly dependent on the original multithreading task processing mechanism, and the problems of waiting overtime, service interruption and the like are avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a diagram illustrating an embodiment of a system for invalidating cached data in accordance with the present invention;
FIG. 2 is a diagram illustrating an embodiment of a state transition of a failed task management module according to the present invention;
FIG. 3 is a block flow diagram of an embodiment of a cache data invalidation based invalidation of task management module and invalidation execution management module provided by the present invention;
FIG. 4 is a diagram illustrating a state transition of a failed task management module according to yet another embodiment of the present invention;
FIG. 5 is a diagram illustrating another embodiment of a state transition of a dead task management module according to the present invention;
FIG. 6 is a diagram illustrating a state transition of a failed task management module according to yet another embodiment of the present invention;
FIG. 7 is a block diagram illustrating an embodiment of a method for invalidating cached data in accordance with the present invention;
FIG. 8 is a schematic block diagram illustrating an embodiment of a computing device;
fig. 9 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of a system for invalidating cached data. As shown in fig. 1, the system specifically includes: a failure task management module 10 and a failure task execution module 20;
the failure task management module 10 is configured to receive a failure request initiated by a volume, add the volume initiating the failure request to a task request array under write lock protection, and schedule a failure subtask to execute the failure request;
the failure task execution module 20 is configured to add all volumes in the task request array into a task execution array and empty the task request array when the failure subtask is performed;
the invalidation task execution module 20 is further configured to traverse a linked list maintaining cache data in a cache partition to obtain cache data based on the linked list, and determine whether to invalidate the cache data based on whether the cache data belongs to a volume in the task performing array;
the failed task execution module 20 is further configured to end the failed subtask in response to the traversal step reaching a threshold, and record a traversal position to a first volume in the task processing array;
the failed task execution module 20 is further configured to compare the traversal position with the linked list tail of the linked list to determine whether to remove the first volume from the task running array and to notify the failed task management module whether to invoke a new subtask to continue executing volumes in the task running array;
the invalidation task execution module 20 is further configured to determine whether the task request array and the task progress array are empty, and determine whether the invalidation task of the cached data is finished based on the determination result.
Specifically, a cache partition where a volume needing to be invalidated is located is bound with an invalidation task management module and an invalidation task execution module, and the invalidation task management module and the invalidation task execution module bound by the cache partition are used for scheduling and executing the invalidation task of cache data in the volume, so that the multi-volume cache data invalidation task is not directly dependent on an original multi-thread task processing mechanism.
And the failure task management module judges whether a new failure task needs to be scheduled or not according to the task state constraint. Fig. 2 is a schematic diagram illustrating state transition of the failed task management module.
The status of the disabled task management module includes IDLE status IDLE, dispatch status wide _ RUN, execute status RUNNING, and wait for dispatch status wide _ RUN _ AGAIN.
When the state is IDLE, the current state is free of invalid tasks, and new tasks can be scheduled; when the state is WILL _ RUN, the fact that the sub-task with the failure is scheduled is shown, namely the sub-task with the failure exists in a thread waiting queue of a certain CPU; RUNNING, indicating that a failed subtask is ongoing; when the status is WILL _ RUN _ AGAIN, it indicates that the currently executed subtask is finished and then a new subtask is rescheduled on the current CPU.
The state transition of the failed task management module is explained by the following procedure.
The failure task management module judges whether a failure task is executed currently or not, and marks the state of the failure task management module as an IDLE if no failure task exists currently; receiving a failure request initiated by the volume, the failure task management module schedules a failure subtask, and modifies the state of the failure task management module from IDLE to WILL _ RUN; after the invalidation task management module schedules the subtasks, when a certain CPU executes the invalidation subtask, the state of the invalidation task management module is modified from WILL _ RUN to RUNNING; modifying the state of the invalidation task management module from RUNNING to wide _ RUN _ AGAIN if invalidation requests from other volumes are received while the subtask is executing; when the subtask ends, if the invalidation requests of all the volumes are executed, the state of the invalidation task management module is changed from RUNNING to IDLE.
The above description describes the state transition of the disabled task management module according to the disabled request, the scheduling of the disabled subtask, and the execution request, and the state transition of the disabled task management module is modified according to the application scenario in the actual application process, which includes but is not limited to the above processes.
The invalidation process of the cache data is explained based on the invalidation task management module and the invalidation task execution module.
A failure task management module: when a certain volume on the cache partition needs invalidation cache data, the invalidation cache data is added into a task request array under the protection of write lock, a new subtask is dispatched, and the state of the invalidation task management module is modified to WILL _ RUN or WILL _ RUN _ AGAIN based on the current invalidation task execution condition. The organization and execution of the subtasks are handed over to the failed task execution module.
A failure task execution module: when a new failure subtask is carried out, firstly, the volume in the task request array is stored in the task carrying array, and the empty task request array is arranged. Then, traversing the partition linked list, finding out cache data (namely effective cache data) with a failure flag bit being FALSE based on the linked list, judging whether the effective cache data belongs to the volume in the task processing array, if so, failing the effective cache data, and setting the failure flag bit as TRUE. And after the primary failure subtask reaches the traversal step length, ending the subtask, and recording the traversal position to the first volume of the task processing array.
When a certain failure subtask is finished, if the recorded traversal position is more than or equal to the tail position of the buffer partition chain table, the cache data of the volume is failed and is removed from the task array; and if the recorded traversal position is smaller than the tail position of the partition chain table or the volume needing to be failed still exists in the task processing array, scheduling a new subtask to continue the process. And ending the tasks of the batch invalidation cache data until the task execution array and the task request array are both empty.
According to the scheme, all volumes in the same cache partition can be invalidated, and the invalidation task management module and the invalidation task and cache partition are bound execution modules, so that the invalidation of the volumes in a plurality of cache partitions can be invalidated simultaneously based on the scheme.
According to the scheme, the invalidation task management module schedules the corresponding subtasks of the cache data invalidation requests (namely invalidation tasks) of one or more volumes of the unified cache partition according to the traversal step length and delivers the corresponding subtasks to the invalidation task execution module for execution, so that batch invalidation processing of the cache data is realized, the batch invalidation processing of the cache data can be efficiently and reliably completed, the invalidation tasks of the multi-volume cache data are not directly dependent on the original multithreading task processing mechanism, and the problems of waiting overtime, service interruption and the like can be avoided.
In some embodiments, traversing a linked list maintaining cache data in a cache partition to obtain cache data based on the linked list comprises:
and traversing the linked list for maintaining the cache data in the cache partition, and acquiring the cache data with a failure flag bit being FALSE based on the linked list.
In some embodiments, determining whether to invalidate the cached data based on whether the cached data belongs to a volume in the task progress array comprises:
judging whether the cache data with the failure flag bit being FALSE belongs to the volume in the task processing array;
and in response to that the cache data with the failure flag bit of FALSE belongs to the volume in the task processing array, setting the failure flag bit of the cache data to TRUE.
In some embodiments, comparing the traversal location to the linked-list tail of the linked-list to determine whether to remove the first volume from the task in array and to notify the failed task management module to invoke a new subtask to continue executing a volume in the task in array includes:
responding to the end of the execution of the failure subtask, and judging whether the traversal position is greater than or equal to the linked list tail of the linked list;
in response to the traversing position being greater than or equal to the tail of the chain table, ending the failure subtask of the first volume, and performing array removal on the first volume from the task;
and responding to the traversing position not more than the tail of the link table, and sending a message to the failure task management module to inform the failure task management module to schedule a new subtask to continue to execute the volume in the task processing array.
In some embodiments, determining whether the task request array and the task progress array are empty, and determining whether the invalidation task of the cached data ends based on the determination result comprises:
judging whether the task request array and the task processing array are empty or not;
responding to the task request array and the task processing array to be empty, and ending the invalidation task of the cache data;
and in response to the fact that the task request array is not empty and the task progress array is not empty or the task request array is not empty and the task progress array is empty or the task request array is empty and the task progress array is not empty, notifying the failure task management module to schedule a new subtask to continue executing the volume in the task progress array.
The invalidation process of the cached data is explained by another embodiment.
Fig. 3 is a block diagram illustrating a flow of invalidating cache data based on an invalidation task management module and an invalidation execution management module.
The specific implementation process is as follows:
1) the invalidation task management module adds the volume needing invalidation into a task request array (only adding once when initiating the task at the volume granularity) under the write lock protection, schedules an invalidation subtask, and modifies the state of the invalidation task management module into WILL _ RUN or WILL _ RUN _ AGAIN according to the current state;
2) in the failure task execution module, when a new subtask is firstly carried out, a volume in a task request array is added into a task array, a linked list for maintaining cache data in a cache partition is traversed, the cache data which is not invalidated and belongs to the volume in the task array is invalidated, and the invalidated cache data is marked as an invalid state, so that the traversal efficiency is improved;
3) in each failure subtask, when the set traversal step length is reached, the current failure subtask is ended, and the traversal end position is recorded to the first volume of the task processing array;
4) when the recorded traversal ending position is more than or equal to the linked list tail position of the linked list for maintaining the cache data in the cache partition, the cache data of the volume is invalid and ended, and the cache data of the volume is removed from the task queue;
5) when the recorded traversal position is smaller than the tail position of the partition chain table or a volume needing to be invalidated still exists in the task processing array, informing the invalidation task management module to schedule a new subtask to continue the steps;
6) and when the task execution array and the task request array are empty, ending the tasks of the batch invalidation cache data.
By the aid of the scheme, batch invalidation processing of the cache data is achieved, invalidation efficiency is improved, and efficient and reliable completion of batch invalidation processing of the cache data is guaranteed.
In some embodiments, the failed task management module is further configured to flag the status of the failed task management module based on the scheduling and execution of the failed subtasks.
In some embodiments, the states of the dead task management module include an idle state, a scheduled state, an execution state, and a wait for scheduled state.
The state transition of the disabled task management module is explained by another embodiment.
As shown in fig. 4, 5, and 6, the state transition diagrams of the failed task management module in different scenarios are shown.
In a first scenario, when a failure subtask is in progress, the failure task execution module is in failure data traversing a cache partition at the moment, if the failure task management module receives a failure request of a new volume in the same cache partition, the new volume is added into a task request array, after the failure task execution module finishes executing the subtask, a message of completion of execution of the subtask is sent to the failure task management module, the failure task management module calls the new subtask, judges that the current state is WILL _ RUN _ AGAIN, and modifies the state of the current state into WILL _ RUN.
And a second scenario, when a failure subtask is in progress, the failure task execution module is traversing failure data of the cache partition, when the failure task execution module finishes executing the subtask, the failure task execution module judges that a volume exists in the task progress array, the message is sent to the failure task management module, the failure task management module calls a new subtask, judges that the current state is RUNNING, and modifies the state of the current state into WILL _ RUN.
And a third scenario, when a failure subtask is in progress, the failure task execution module is traversing failure data of the cache partition, when the failure task execution module finishes executing the subtask, the failure task execution module judges that the task progress array is empty and the task request array is empty, the message is sent to the failure task management module, the failure task management module calls a new subtask, judges that the current state is RUNNING, and modifies the state of the new subtask into RUNNING.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 7, an embodiment of the present invention further provides a method for invalidating cached data, including:
s10, receiving a failure request initiated by a roll based on a failure task management module, adding the roll initiated with the failure request into a task request array under write lock protection, and scheduling a failure subtask to execute the failure request;
s20, when the failure subtask is in progress, adding all volumes in the task request array into a task execution array based on a failure task execution module, and emptying the task request array;
s30, traversing a linked list maintaining cache data in a cache partition based on the invalidation task execution module to acquire the cache data based on the linked list, and judging whether the cache data is invalidated based on whether the cache data belongs to a volume in the task processing array;
s40, responding to the traversing step length reaching a threshold value, finishing the failure subtask based on the failure task execution module, and recording the traversing position to the first volume in the task processing array;
s50, comparing the traversal position with the linked list tail of the linked list based on the failure task execution module to determine whether to remove the first volume from the task array and whether to inform the failure task management module to call a new subtask to continue executing the volume in the task array;
s60, judging whether the task request array and the task processing array are empty based on the invalidation task execution module, and determining whether the invalidation task of the cache data is finished based on the judgment result.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 8, the embodiment of the present invention further provides a computer device 30, in which the computer device 30 comprises a processor 310 and a memory 320, the memory 320 stores a computer program 321 that can run on the processor, and the processor 310 executes the program to perform the steps of the method.
The memory, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for invalidating cached data in the embodiments of the present application. The processor executes various functional applications and data processing of the device by running the nonvolatile software programs, instructions and modules stored in the memory, that is, the method for invalidating cached data of the above-described method embodiments is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 9, an embodiment of the present invention further provides a computer-readable storage medium 40, and the computer-readable storage medium 40 stores a computer program 410 which, when executed by a processor, performs the above method.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant only to be exemplary, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit or scope of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A system for invalidating cached data, comprising:
the system comprises a failure task management module and a failure task execution module;
the failure task management module is configured to receive a failure request initiated by a volume, add the volume initiating the failure request into a task request array under write lock protection, and schedule a failure subtask for executing the failure request;
the failure task execution module is configured to add all volumes in the task request array into a task execution array and empty the task request array when the failure subtask is performed;
the invalidation task execution module is also configured to traverse a linked list maintaining cache data in a cache partition to obtain the cache data based on the linked list, and determine whether to invalidate the cache data based on whether the cache data belongs to a volume in the task processing array;
the failure task execution module is further configured to respond to the traversal step size reaching a threshold value, end the failure subtask, and record a traversal position to a first volume in the task processing array;
the failure task execution module is further configured to compare the traversal position with a linked list tail of the linked list to determine whether to remove the first volume from the task running array and whether to inform the failure task management module to call a new subtask to continue executing the volume in the task running array;
the invalidation task execution module is also configured to judge whether the task request array and the task progress array are empty, and determine whether the invalidation task of the cache data is finished based on the judgment result.
2. The system of claim 1, wherein traversing a linked list of cache data maintained in a cache partition to obtain cache data based on the linked list comprises:
and traversing the linked list for maintaining the cache data in the cache partition, and acquiring the cache data with a failure flag bit of FALSE based on the linked list.
3. The system of claim 2, wherein determining whether to invalidate the cached data based on whether the cached data belongs to a volume in the task progress array comprises:
judging whether the cache data with the failure flag bit being FALSE belongs to the volume in the task processing array;
and in response to that the cache data with the failure flag bit of FALSE belongs to the volume in the task processing array, setting the failure flag bit of the cache data to TRUE.
4. The system of claim 1, wherein comparing the traversal location to a linked-list tail of the linked-list to determine whether to remove the first volume from the task progress array and to notify the failed task management module to invoke a new subtask to continue executing a volume in the task progress array comprises:
responding to the end of the execution of the failure subtask, and judging whether the traversal position is greater than or equal to the linked list tail of the linked list;
in response to the traversing position being greater than or equal to the tail of the chain table, ending the failure subtask of the first volume, and performing array removal on the first volume from the task;
and responding to the traversal position not larger than the tail of the chain table, and sending a message to the failure task management module to inform the failure task management module to schedule a new subtask to continue to execute the volume in the task processing array.
5. The system of claim 1, wherein determining whether the task request array and the task progress array are empty and determining whether the stale task of cached data ends based on the determination comprises:
judging whether the task request array and the task processing array are empty or not;
responding to the task request array and the task processing array to be empty, and ending the invalidation task of the cache data;
and in response to the fact that the task request array is not empty and the task progress array is not empty or the task request array is not empty and the task progress array is empty or the task request array is empty and the task progress array is not empty, notifying the failure task management module to schedule a new subtask to continue executing the volume in the task progress array.
6. The system of claim 1, wherein the failed task management module is further configured to flag the status of the failed task management module accordingly based on scheduling and execution of failed subtasks.
7. The system of claim 6, wherein the status of the dead task management module comprises an idle status, a scheduled status, an executing status, and a waiting for scheduling status.
8. A method for invalidating cached data, comprising:
receiving a failure request initiated by a volume based on a failure task management module, adding the volume initiating the failure request into a task request array under write lock protection, and scheduling a failure subtask to execute the failure request;
when the failure subtask is carried out, adding all volumes in the task request array into a task execution array based on a failure task execution module, and emptying the task request array;
traversing a linked list of maintenance cache data in a cache partition based on the invalidation task execution module to acquire cache data based on the linked list, and judging whether the cache data is invalidated based on whether the cache data belongs to a volume in the task execution array;
in response to the traversing step reaching a threshold value, finishing the failure subtask based on the failure task execution module, and recording a traversing position to a first volume in the task processing array;
comparing the traversal position with the linked list tail of the linked list based on the failed task execution module to determine whether to remove the first volume from the task progress array and whether to inform the failed task management module to call a new subtask to continue executing the volume in the task progress array;
and judging whether the task request array and the task processing array are empty or not based on the invalidation task execution module, and determining whether the invalidation task of the cache data is finished or not based on a judgment result.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to claim 8.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method as claimed in claim 8.
CN202210756398.6A 2022-06-30 2022-06-30 System, method, equipment and medium for invalidation cache data Pending CN115033501A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210756398.6A CN115033501A (en) 2022-06-30 2022-06-30 System, method, equipment and medium for invalidation cache data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210756398.6A CN115033501A (en) 2022-06-30 2022-06-30 System, method, equipment and medium for invalidation cache data

Publications (1)

Publication Number Publication Date
CN115033501A true CN115033501A (en) 2022-09-09

Family

ID=83126328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210756398.6A Pending CN115033501A (en) 2022-06-30 2022-06-30 System, method, equipment and medium for invalidation cache data

Country Status (1)

Country Link
CN (1) CN115033501A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116599973A (en) * 2023-07-11 2023-08-15 天津卓朗昆仑云软件技术有限公司 Data transmission method and device based on BT service acceleration component

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116599973A (en) * 2023-07-11 2023-08-15 天津卓朗昆仑云软件技术有限公司 Data transmission method and device based on BT service acceleration component
CN116599973B (en) * 2023-07-11 2023-09-26 天津卓朗昆仑云软件技术有限公司 Data transmission method and device based on BT service acceleration component

Similar Documents

Publication Publication Date Title
US9798595B2 (en) Transparent user mode scheduling on traditional threading systems
CN108647104B (en) Request processing method, server and computer readable storage medium
CN111427751B (en) Method and system for processing business based on asynchronous processing mechanism
US8392932B2 (en) Information processing device for causing a processor to context switch between threads including storing contexts based on next thread start position
US20120284720A1 (en) Hardware assisted scheduling in computer system
US20130097382A1 (en) Multi-core processor system, computer product, and control method
US20090100196A1 (en) Generic shared memory barrier
CN111078394B (en) GPU thread load balancing method and device
US6721948B1 (en) Method for managing shared tasks in a multi-tasking data processing system
CN115033501A (en) System, method, equipment and medium for invalidation cache data
CN112463400A (en) Real-time data distribution method and device based on shared memory
Liu et al. Optimizing shuffle in wide-area data analytics
US20140149994A1 (en) Parallel computer and control method thereof
US9558035B2 (en) System and method for supporting adaptive busy wait in a computing environment
CN112380030A (en) Main task processing method, device, server and storage medium
CN110287159B (en) File processing method and device
US9015717B2 (en) Method for processing tasks in parallel and selecting a network for communication
CN115114022A (en) Method, system, device and medium for using GPU resources
CN114741166A (en) Distributed task processing method, distributed system and first equipment
CN113806065A (en) Data processing method, device and storage medium
CN110955539A (en) Process quitting method and device, electronic equipment and machine-readable storage medium
CN114327828B (en) Lock-free concurrent access method, device, equipment and medium for shared data
CN111163158B (en) Data processing method and electronic equipment
CN116643855A (en) Method and system for guaranteeing reliability of thread pool under high concurrency
JP4833911B2 (en) Processor unit and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination