/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /* * Copyright 2014-2022 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. *
*/
/** * struct device_queue_manager_ops * * @create_queue: Queue creation routine. * * @destroy_queue: Queue destruction routine. * * @update_queue: Queue update routine. * * @exeute_queues: Dispatches the queues list to the H/W. * * @register_process: This routine associates a specific process with device. * * @unregister_process: destroys the associations between process to device. * * @initialize: Initializes the pipelines and memory module for that device. * * @start: Initializes the resources/modules the device needs for queues * execution. This function is called on device initialization and after the * system woke up after suspension. * * @stop: This routine stops execution of all the active queue running on the * H/W and basically this function called on system suspend. * * @uninitialize: Destroys all the device queue manager resources allocated in * initialize routine. * * @halt: This routine unmaps queues from runlist and set halt status to true * so no more queues will be mapped to runlist until unhalt. * * @unhalt: This routine unset halt status to flase and maps queues back to * runlist. * * @create_kernel_queue: Creates kernel queue. Used for debug queue. * * @destroy_kernel_queue: Destroys kernel queue. Used for debug queue. * * @set_cache_memory_policy: Sets memory policy (cached/ non cached) for the * memory apertures. * * @process_termination: Clears all process queues belongs to that device. * * @evict_process_queues: Evict all active queues of a process * * @restore_process_queues: Restore all evicted queues of a process * * @get_wave_state: Retrieves context save state and optionally copies the * control stack, if kept in the MQD, to the given userspace address. * * @reset_queues: reset queues which consume RAS poison * @get_queue_checkpoint_info: Retrieves queue size information for CRIU checkpoint. * * @checkpoint_mqd: checkpoint queue MQD contents for CRIU.
*/
struct dqm_detect_hang_info { int pipe_id; int queue_id; int xcc_id;
uint64_t queue_address;
};
/** * struct device_queue_manager * * This struct is a base class for the kfd queues scheduler in the * device level. The device base class should expose the basic operations * for queue creation and queue destruction. This base class hides the * scheduling mode of the driver and the specific implementation of the * concrete device. This class is the only class in the queues scheduler * that configures the H/W. *
*/
/* The DQM lock can be taken in MMU notifiers. Make sure no reclaim-FS * happens while holding this lock anywhere to prevent deadlocks when * an MMU notifier runs in reclaim-FS context.
*/ staticinlinevoid dqm_lock(struct device_queue_manager *dqm)
{
mutex_lock(&dqm->lock_hidden);
dqm->saved_flags = memalloc_noreclaim_save();
} staticinlinevoid dqm_unlock(struct device_queue_manager *dqm)
{
memalloc_noreclaim_restore(dqm->saved_flags);
mutex_unlock(&dqm->lock_hidden);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.