Skip to content

Commit

Permalink
Merge tag 'misc-5.12-2021-03-02' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull misc fixes from Jens Axboe:
 "Two misc fixes that don't belong in other branches:

   - Fix a regression with ia64 signals, introduced by the
     TIF_NOTIFY_SIGNAL change in 5.11.

   - Fix the current swapfile regression from this merge window"

* tag 'misc-5.12-2021-03-02' of git://git.kernel.dk/linux-block:
  swap: fix swapfile read/write offset
  ia64: don't call handle_signal() unless there's actually a signal queued
  • Loading branch information
torvalds committed Mar 3, 2021
2 parents 7a7fd0d + caf6912 commit f69d02e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion arch/ia64/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
* need to push through a forced SIGSEGV.
*/
while (1) {
get_signal(&ksig);
if (!get_signal(&ksig))
break;

/*
* get_signal() may have run a debugger (via notify_parent())
Expand Down
1 change: 1 addition & 0 deletions include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ struct backing_dev_info;
extern int init_swap_address_space(unsigned int type, unsigned long nr_pages);
extern void exit_swap_address_space(unsigned int type);
extern struct swap_info_struct *get_swap_device(swp_entry_t entry);
sector_t swap_page_sector(struct page *page);

static inline void put_swap_device(struct swap_info_struct *si)
{
Expand Down
5 changes: 0 additions & 5 deletions mm/page_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
return ret;
}

static sector_t swap_page_sector(struct page *page)
{
return (sector_t)__page_file_index(page) << (PAGE_SHIFT - 9);
}

static inline void count_swpout_vm_event(struct page *page)
{
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
Expand Down
13 changes: 13 additions & 0 deletions mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,19 @@ offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)
BUG();
}

sector_t swap_page_sector(struct page *page)
{
struct swap_info_struct *sis = page_swap_info(page);
struct swap_extent *se;
sector_t sector;
pgoff_t offset;

offset = __page_file_index(page);
se = offset_to_swap_extent(sis, offset);
sector = se->start_block + (offset - se->start_page);
return sector << (PAGE_SHIFT - 9);
}

/*
* swap allocation tell device that a cluster of swap can now be discarded,
* to allow the swap device to optimize its wear-levelling.
Expand Down

0 comments on commit f69d02e

Please sign in to comment.