-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor CONFIG_SPE
check on Linux/powerpc
#14623
Conversation
Hold on! When testing with Working on fixes. |
What can go wrong, it's a simple ifdef ... when it's wrong, it was also wrong before. |
Signed-off-by: WHR <msl0000023508@gmail.com>
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Signed-off-by: WHR <msl0000023508@gmail.com>
592bed1
to
0ed5911
Compare
I like this code snippet more:
Edit: Some tabs an backslashes are not set ... but you see what I mean ;-) |
But |
YES, you are right, and inlining would be bad for performance :-/ Can we take the
|
This should also be ok, I think. |
#else /* CONFIG_SPE */ | ||
#ifdef CONFIG_SPE | ||
#define ENABLE_KERNEL_SPE enable_kernel_spe() | ||
#define DISABLE_KERNEL_SPE disable_kernel_spe() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From:
#define ENABLE_KERNEL_SPE enable_kernel_spe()
#define DISABLE_KERNEL_SPE disable_kernel_spe()
To:
#define ENABLE_KERNEL_SPE enable_kernel_spe();
#define DISABLE_KERNEL_SPE disable_kernel_spe();
Then I will approve ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the preference for including the ;
in the #define? This seems like it should be purely cosmetic, and our usual convention is to not hide it in the macro. Though I don't feel strongly about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's just cosmetic. My variant just defines it all away
- which seems nicer to me.
But when there is a usual convention which does does not hide the ;
- then we should follow this convention.
@Low-power - sorry for the noise ;-)
ENABLE_KERNEL_VSX \ | ||
ENABLE_KERNEL_ALTIVEC; \ | ||
ENABLE_KERNEL_VSX; \ | ||
ENABLE_KERNEL_SPE; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here the other way:
ENABLE_KERNEL_SPE;
--> ENABLE_KERNEL_SPE
Before I going to amend my commits, I would like to ask, are you sure this is better? I mean, by searching the source tree, the only occurrences of
|
0ed5911
to
69ff0e1
Compare
Tested with Linux 5.15.96 and 6.2.1. |
Sorry ... if you want, you can rebase to the first variant. Both variants are fine and fix the ppc64 code path. |
Well, if I change the grep(1) command to
it will give some more results. And I also found the similar style in your recent commit fe6a7b7 (macro I added those macros simply because the impossibility of using Anyway if the other style is desired, it should still be available on 0ed5911. |
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes #14623
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Commit 5401472 adds a check to call enable_kernel_spe and disable_kernel_spe only if CONFIG_SPE is defined. Refactor this check in a way similar to what CONFIG_ALTIVEC and CONFIG_VSX are checked, in order to remove redundant kfpu_begin() and kfpu_end() implementations. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: WHR <msl0000023508@gmail.com> Closes openzfs#14623
Motivation and Context
Commit 5401472 adds a check to call
enable_kernel_spe
anddisable_kernel_spe
only ifCONFIG_SPE
is defined. This introduces redundant implementations ofkfpu_begin()
andkfpu_end()
.Description
Refactor this check in a way similar to what
CONFIG_ALTIVEC
andCONFIG_VSX
are checked in #14591, in order to remove redundant codes.How Has This Been Tested?
Tested on my POWER7-based machine without
CONFIG_SPE
. May need more testings on machines withCONFIG_SPE
.Types of changes
Checklist:
Signed-off-by
.