Skip to content
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

[Deepin-Kernel-SIG] [Backport] [linux 6.6-y] Backport some commits by Uniontech in v6.14-rc3 #600

Merged

Conversation

Avenger-285714
Copy link
Collaborator

@Avenger-285714 Avenger-285714 commented Feb 17, 2025

Summary by Sourcery

Enhancements:

  • Remove the proc_cpuinfo_notifier API and simplify the output of /proc/cpuinfo

Copy link

sourcery-ai bot commented Feb 17, 2025

Reviewer's Guide by Sourcery

This pull request removes the notifier chain related to proc_cpuinfo, modifies the output format of hardware watchpoint information, and adds a forward declaration for struct seq_file in asm/smp.h.

Updated class diagram for cpu-info.h

classDiagram
    class cpu-info.h {
        <<removed>>
        -register_proc_cpuinfo_notifier(struct notifier_block *nb)
        <<removed>>
        -proc_cpuinfo_notifier_call_chain(unsigned long val, void *v)
        <<removed>>
        -proc_cpuinfo_notifier(fn, pri)
        <<removed>>
        -proc_cpuinfo_notifier_args
    }
Loading

File-Level Changes

Change Details Files
Removed the notifier chain for proc_cpuinfo.
  • Removed proc_cpuinfo_chain raw notifier head.
  • Removed register_proc_cpuinfo_notifier function.
  • Removed proc_cpuinfo_notifier_call_chain function.
  • Removed proc_cpuinfo_notifier macro.
  • Removed proc_cpuinfo_notifier_args structure.
  • Removed the call to raw_notifier_call_chain within show_cpuinfo.
arch/loongarch/kernel/proc.c
arch/loongarch/include/asm/cpu-info.h
Modified the output format of hardware watchpoint information in show_cpuinfo.
  • Replaced the explicit "yes"/"no" output with a call to str_yes_no.
  • Consolidated the watchpoint counts into a single seq_printf call.
arch/loongarch/kernel/proc.c
Added forward declaration of struct seq_file in asm/smp.h.
  • Added struct seq_file; to arch/loongarch/include/asm/smp.h.
arch/loongarch/include/asm/smp.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

[ Upstream commit 03a99d16e64fad41c8d39700bef9b0ac9c4e148b ]

Remove hard-coded strings by using the str_yes_no() helper function.

Similar to commit c4a0a4a45a45 ("MIPS: kernel: proc: Use str_yes_no()
helper function").

Co-developed-by: Wentao Guan <[email protected]>
Signed-off-by: Wentao Guan <[email protected]>
Signed-off-by: Yuli Wang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
[ Backport from v6.14-rc3 ]
Signed-off-by: WangYuli <[email protected]>
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Avenger-285714 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using seq_puts instead of seq_printf when printing constant strings to improve performance.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

[ Upstream commit 6b72cd9ef062702390fc96c469beea1729a5dffe ]

The notifier hook mechanism in proc and cpuinfo is actually unnecessary
for LoongArch because it's not used anywhere.

It was originally added to the MIPS code in commit d6d3c9a ("MIPS:
MT: proc: Add support for printing VPE and TC ids"), and LoongArch then
inherited it.

But as the kernel code stands now, this notifier hook mechanism doesn't
really make sense for either LoongArch or MIPS.

In addition, the seq_file forward declaration needs to be moved to its
proper place, as only the show_ipi_list() function in smp.c requires it.

Co-developed-by: Wentao Guan <[email protected]>
Signed-off-by: Wentao Guan <[email protected]>
Signed-off-by: Yuli Wang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
[ Backport from v6.14-rc3 ]
Signed-off-by: WangYuli <[email protected]>
@Avenger-285714 Avenger-285714 merged commit 550800a into deepin-community:linux-6.6.y Feb 17, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant