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

Lecture typo fixes and cscope optimization #19

Merged
merged 3 commits into from
Mar 4, 2018

Conversation

Sergiu121
Copy link

For more info into the compiled source option check this link: https://patchwork.kernel.org/patch/1834701/

tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 2, 2018
Copy link
Member

@tavip tavip left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes. Overall looks good there are just minor nits I would like you to fix, please see my inline comments.

@@ -69,6 +69,13 @@ architecture through the ARCH variable is optional but recommended;
otherwise, some architecture dependent functions will appear multiple
times in the database.

You can build the cscope database with the command :command:`make ARCH
= x86 COMPILED_SOURCE = 1 cscope`. This way, the cscope database will
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the spaces before and after =

Copy link
Author

Choose a reason for hiding this comment

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

I followed the pattern from the above paragraph, where spaces are used. Should I delete the spaces from there too?

Copy link
Member

Choose a reason for hiding this comment

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

yes

a particular user process. The kernel space is accessed protected so
that user applications can not access it directly, while user space
can be directly accessed from code running in kernel mode.
reserved to the kernel while user space is the memory area
Copy link
Member

Choose a reason for hiding this comment

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

This looks like newlines changes only, please revert this hunk.

crafted:

.. slide:: Marking kernel code that accesses user space
:inline-contents: True
:level: 2

* The exact instructions that access user space are recorded in a
table (exception table)
* The exact instructions that access user space are recorded
Copy link
Member

Choose a reason for hiding this comment

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

Same here, looks like newlines changes only.

@@ -372,7 +372,8 @@ With VDSO the system call interface is decided by the kernel:
:level: 2

* a stream of instructions to issue the system call is generated by
the kernel in a special memory area (as en ELF .so)
the kernel in a special memory area (in memory it is formated as
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "(formatted as an ELF shared object)" is better? Since it is in memory, it is not a file :)

tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 3, 2018
tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 3, 2018
tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 3, 2018
tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 3, 2018
tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 3, 2018
@Sergiu121
Copy link
Author

Sergiu121 commented Mar 4, 2018

@i have made the changes. Please review the pull request again.

tavip pushed a commit to linux-kernel-labs/linux-kernel-labs.github.io that referenced this pull request Mar 4, 2018
@dbaluta dbaluta merged commit e23b879 into linux-kernel-labs:master Mar 4, 2018
dbaluta pushed a commit to dbaluta/linux that referenced this pull request Nov 7, 2019
When the client hits reconnect it iterates over the mid
pending queue marking entries for retry and moving them
to a temporary list to issue callbacks later without holding
GlobalMid_Lock. In the same time there is no guarantee that
mids can't be removed from the temporary list or even
freed completely by another thread. It may cause a temporary
list corruption:

[  430.454897] list_del corruption. prev->next should be ffff98d3a8f316c0, but was 2e885cb266355469
[  430.464668] ------------[ cut here ]------------
[  430.466569] kernel BUG at lib/list_debug.c:51!
[  430.468476] invalid opcode: 0000 [#1] SMP PTI
[  430.470286] CPU: 0 PID: 13267 Comm: cifsd Kdump: loaded Not tainted 5.4.0-rc3+ linux-kernel-labs#19
[  430.473472] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[  430.475872] RIP: 0010:__list_del_entry_valid.cold+0x31/0x55
...
[  430.510426] Call Trace:
[  430.511500]  cifs_reconnect+0x25e/0x610 [cifs]
[  430.513350]  cifs_readv_from_socket+0x220/0x250 [cifs]
[  430.515464]  cifs_read_from_socket+0x4a/0x70 [cifs]
[  430.517452]  ? try_to_wake_up+0x212/0x650
[  430.519122]  ? cifs_small_buf_get+0x16/0x30 [cifs]
[  430.521086]  ? allocate_buffers+0x66/0x120 [cifs]
[  430.523019]  cifs_demultiplex_thread+0xdc/0xc30 [cifs]
[  430.525116]  kthread+0xfb/0x130
[  430.526421]  ? cifs_handle_standard+0x190/0x190 [cifs]
[  430.528514]  ? kthread_park+0x90/0x90
[  430.530019]  ret_from_fork+0x35/0x40

Fix this by obtaining extra references for mids being retried
and marking them as MID_DELETED which indicates that such a mid
has been dequeued from the pending list.

Also move mid cleanup logic from DeleteMidQEntry to
_cifs_mid_q_entry_release which is called when the last reference
to a particular mid is put. This allows to avoid any use-after-free
of response buffers.

The patch needs to be backported to stable kernels. A stable tag
is not mentioned below because the patch doesn't apply cleanly
to any actively maintained stable kernel.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Reviewed-and-tested-by: David Wysochanski <[email protected]>
Signed-off-by: Pavel Shilovsky <[email protected]>
Signed-off-by: Steve French <[email protected]>
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.

3 participants