Skip to content

Commit

Permalink
Merge pull request #61 from lorelei-sakai/fix/max-discard-size
Browse files Browse the repository at this point in the history
[VDO-5791] Fix discard problem due to upstream dm changes
  • Loading branch information
lorelei-sakai committed Aug 2, 2024
2 parents 48ef0ba + cf02639 commit c617225
Show file tree
Hide file tree
Showing 17 changed files with 303 additions and 82 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
pull_request_target:
types: [ opened, reopened, ready_for_review, synchronize ]
workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Verifying:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Start verification
run: echo Verification Start

# Run assignment action
- name: Assign reviewers and assignees
uses: dm-vdo/vdo-auto-assign@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove all known labels
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
labels: untested, private testing running, private testing done, private testing failed
type: remove

- name: Add untested label
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: untested
type: add

Testing:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, trusted]
needs: [Verifying]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: dm-linux

- uses: actions/checkout@v2
with:
repository: ${{ github.event.repository.owner.login }}/vdo-devel
path: vdo-devel

- name: Add private testing running label
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: add

- name: Start private testing
run: |
cd ${{ github.workspace }}/vdo-devel/src/
make DMLINUX_SOURCE_DIR=${{ github.workspace }}/dm-linux dmlinux-jenkins
- name: Copy log file to /permatbit/user/bunsen/artifacts
if: failure()
run: |
REPO=${{ github.repository }}
REPO=${REPO//\//-}
cp -a ${{ github.workspace }}/vdo-devel/logs /permabit/user/bunsen/artifacts/logs.`date +'%Y%m%d%H%M'`.$REPO.${{ github.event.number }}
- name: Remove private testing running label
if: always()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: remove

- name: Add private testing failed
if: failure()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing failed
type: add

- name: Add private testing success
if: success()
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: private testing done
type: add
98 changes: 98 additions & 0 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Notify

on:
schedule:
- cron: '0 0,2,10,12,14,16,18,20,22 * * 1-5'
workflow_dispatch:

jobs:
notify_schedule:
env:
ORG: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- name: Notify PRs Needing Review
uses: octokit/[email protected]
id: prs_need_review
with:
query: |
query needreview($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{ env.ORG }}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:required,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs awaiting reviews in ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Arequired"
}
env:
COUNT: ${{ fromJSON(steps.prs_need_review.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}

- name: Notify PRs With Feedback
uses: octokit/[email protected]
id: prs_with_feedback
with:
query: |
query withfeedback($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{env.ORG}}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:changes_requested,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs awaiting replies to reviews ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Achanges_requested"
}
env:
COUNT: ${{ fromJSON(steps.prs_with_feedback.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}


- name: Notify PRs With Approval
uses: octokit/[email protected]
id: prs_with_approval
with:
query: |
query withapproval($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{env.ORG}}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:approved,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs approved in ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Aapproved"
}
env:
COUNT: ${{ fromJSON(steps.prs_with_approval.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}
5 changes: 5 additions & 0 deletions Documentation/admin-guide/device-mapper/dm-crypt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ same_cpu_crypt
The default is to use an unbound workqueue so that encryption work
is automatically balanced between available CPUs.

high_priority
Set dm-crypt workqueues and the writer thread to high priority. This
improves throughput and latency of dm-crypt while degrading general
responsiveness of the system.

submit_from_crypt_cpus
Disable offloading writes to a separate thread after encryption.
There are some situations where offloading write bios from the
Expand Down
5 changes: 2 additions & 3 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3394,8 +3394,8 @@ static void set_discard_limits(struct cache *cache, struct queue_limits *limits)

if (!cache->features.discard_passdown) {
/* No passdown is done so setting own virtual limits */
limits->max_discard_sectors = min_t(sector_t, cache->discard_block_size * 1024,
cache->origin_sectors);
limits->max_hw_discard_sectors = min_t(sector_t, cache->discard_block_size * 1024,
cache->origin_sectors);
limits->discard_granularity = cache->discard_block_size << SECTOR_SHIFT;
return;
}
Expand All @@ -3404,7 +3404,6 @@ static void set_discard_limits(struct cache *cache, struct queue_limits *limits)
* cache_iterate_devices() is stacking both origin and fast device limits
* but discards aren't passed to fast device, so inherit origin's limits.
*/
limits->max_discard_sectors = origin_limits->max_discard_sectors;
limits->max_hw_discard_sectors = origin_limits->max_hw_discard_sectors;
limits->discard_granularity = origin_limits->discard_granularity;
limits->discard_alignment = origin_limits->discard_alignment;
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-clone-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,8 @@ static void set_discard_limits(struct clone *clone, struct queue_limits *limits)
if (!test_bit(DM_CLONE_DISCARD_PASSDOWN, &clone->flags)) {
/* No passdown is done so we set our own virtual limits */
limits->discard_granularity = clone->region_size << SECTOR_SHIFT;
limits->max_discard_sectors = round_down(UINT_MAX >> SECTOR_SHIFT, clone->region_size);
limits->max_hw_discard_sectors = round_down(UINT_MAX >> SECTOR_SHIFT,
clone->region_size);
return;
}

Expand All @@ -2059,7 +2060,6 @@ static void set_discard_limits(struct clone *clone, struct queue_limits *limits)
* device limits but discards aren't passed to the source device, so
* inherit destination's limits.
*/
limits->max_discard_sectors = dest_limits->max_discard_sectors;
limits->max_hw_discard_sectors = dest_limits->max_hw_discard_sectors;
limits->discard_granularity = dest_limits->discard_granularity;
limits->discard_alignment = dest_limits->discard_alignment;
Expand Down
Loading

0 comments on commit c617225

Please sign in to comment.