All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Harrison <john.c.harrison@intel.com>
To: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	<intel-gfx@lists.freedesktop.org>
Cc: <dri-devel@lists.freedesktop.org>,
	Matthew Brost <matthew.brost@intel.com>,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc/slpc: remove unneeded clflush calls
Date: Wed, 15 Sep 2021 12:29:12 -0700	[thread overview]
Message-ID: <b6b996be-b60c-41f1-e531-77c2bcdda920@intel.com> (raw)
In-Reply-To: <27c071ae-13b8-d71d-d869-e9cbd7431afd@intel.com>

On 9/15/2021 12:24, Belgaumkar, Vinay wrote:
> On 9/14/2021 12:51 PM, Lucas De Marchi wrote:
>> The clflush calls here aren't doing anything since we are not writting
>> something and flushing the cache lines to be visible to GuC. Here the
>> intention seems to be to make sure whatever GuC has written is visible
>> to the CPU before we read them. However a clflush from the CPU side is
>> the wrong instruction to use.
Is there a right instruction to use? Either we need to verify that no 
flush/invalidate is required or we need to add in a replacement that 
does the correct thing?

John.

>>
>>  From code inspection on the other clflush() calls in i915/gt/uc/ these
>> are the only ones with this behavrior. The others are apparently making
>> sure what we write is visible to GuC.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> index 65a3e7fdb2b2..2e996b77df80 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> @@ -108,7 +108,6 @@ static u32 slpc_get_state(struct intel_guc_slpc 
>> *slpc)
>>         GEM_BUG_ON(!slpc->vma);
>>   -    drm_clflush_virt_range(slpc->vaddr, sizeof(u32));
>>       data = slpc->vaddr;
>>         return data->header.global_state;
>> @@ -172,8 +171,6 @@ static int slpc_query_task_state(struct 
>> intel_guc_slpc *slpc)
>>           drm_err(&i915->drm, "Failed to query task state (%pe)\n",
>>               ERR_PTR(ret));
>>   -    drm_clflush_virt_range(slpc->vaddr, SLPC_PAGE_SIZE_BYTES);
>> -
>
> LGTM.
> Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
>
>>       return ret;
>>   }
>>


WARNING: multiple messages have this Message-ID (diff)
From: John Harrison <john.c.harrison@intel.com>
To: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	<intel-gfx@lists.freedesktop.org>
Cc: <dri-devel@lists.freedesktop.org>,
	Matthew Brost <matthew.brost@intel.com>,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH] drm/i915/guc/slpc: remove unneeded clflush calls
Date: Wed, 15 Sep 2021 12:29:12 -0700	[thread overview]
Message-ID: <b6b996be-b60c-41f1-e531-77c2bcdda920@intel.com> (raw)
In-Reply-To: <27c071ae-13b8-d71d-d869-e9cbd7431afd@intel.com>

On 9/15/2021 12:24, Belgaumkar, Vinay wrote:
> On 9/14/2021 12:51 PM, Lucas De Marchi wrote:
>> The clflush calls here aren't doing anything since we are not writting
>> something and flushing the cache lines to be visible to GuC. Here the
>> intention seems to be to make sure whatever GuC has written is visible
>> to the CPU before we read them. However a clflush from the CPU side is
>> the wrong instruction to use.
Is there a right instruction to use? Either we need to verify that no 
flush/invalidate is required or we need to add in a replacement that 
does the correct thing?

John.

>>
>>  From code inspection on the other clflush() calls in i915/gt/uc/ these
>> are the only ones with this behavrior. The others are apparently making
>> sure what we write is visible to GuC.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> index 65a3e7fdb2b2..2e996b77df80 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
>> @@ -108,7 +108,6 @@ static u32 slpc_get_state(struct intel_guc_slpc 
>> *slpc)
>>         GEM_BUG_ON(!slpc->vma);
>>   -    drm_clflush_virt_range(slpc->vaddr, sizeof(u32));
>>       data = slpc->vaddr;
>>         return data->header.global_state;
>> @@ -172,8 +171,6 @@ static int slpc_query_task_state(struct 
>> intel_guc_slpc *slpc)
>>           drm_err(&i915->drm, "Failed to query task state (%pe)\n",
>>               ERR_PTR(ret));
>>   -    drm_clflush_virt_range(slpc->vaddr, SLPC_PAGE_SIZE_BYTES);
>> -
>
> LGTM.
> Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
>
>>       return ret;
>>   }
>>


  reply	other threads:[~2021-09-15 19:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 19:51 [Intel-gfx] [PATCH] drm/i915/guc/slpc: remove unneeded clflush calls Lucas De Marchi
2021-09-14 19:51 ` Lucas De Marchi
2021-09-14 20:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-09-14 20:35 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-09-14 23:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc/slpc: remove unneeded clflush calls (rev2) Patchwork
2021-09-15  0:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-15  2:39 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-09-15 19:24 ` [Intel-gfx] [PATCH] drm/i915/guc/slpc: remove unneeded clflush calls Belgaumkar, Vinay
2021-09-15 19:24   ` Belgaumkar, Vinay
2021-09-15 19:29   ` John Harrison [this message]
2021-09-15 19:29     ` John Harrison
2021-09-21  5:47     ` [Intel-gfx] " Lucas De Marchi
2021-09-21  5:47       ` Lucas De Marchi
2021-09-21 13:06       ` [Intel-gfx] " Ville Syrjälä
2021-09-23  5:37         ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6b996be-b60c-41f1-e531-77c2bcdda920@intel.com \
    --to=john.c.harrison@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=vinay.belgaumkar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.